Class WebSocketFramePriority

java.lang.Object
io.undertow.websockets.core.WebSocketFramePriority
All Implemented Interfaces:
FramePriority<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>

public class WebSocketFramePriority extends Object implements FramePriority<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
Web socket frame priority
Author:
Stuart Douglas
  • Constructor Details

    • WebSocketFramePriority

      public WebSocketFramePriority()
  • Method Details

    • insertFrame

      public boolean insertFrame(StreamSinkFrameChannel newFrame, List<StreamSinkFrameChannel> pendingFrames)
      Description copied from interface: FramePriority
      Inserts the new frame at the correct location in the pending frame list. Note that this must never insert a frame at the very start of the senders list, as this frame has already been activated. This method should return true if the frame was successfully inserted into the pending frame list, if it returns false the frame must not be inserted and will be added to the held frames list instead. Frames held in the held frames list are frames that are not yet ready to be included in the pending frame list, generally because other frames have to be written first. Note that if this method returns true without adding the frame the frame will be dropped.
      Specified by:
      insertFrame in interface FramePriority<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
      Parameters:
      newFrame - The new frame to insert into the pending frame list
      pendingFrames - The pending frame list
      Returns:
      true if the frame can be inserted into the pending frame list
    • frameAdded

      public void frameAdded(StreamSinkFrameChannel addedFrame, List<StreamSinkFrameChannel> pendingFrames, Deque<StreamSinkFrameChannel> holdFrames)
      Description copied from interface: FramePriority
      Invoked when a new frame is successfully added to the pending frames queue. If frames in the held frame queue are now eligible to be sent they can be added to the pending frames queue. Note that if the protocol has explicitly asked for the held frames to be recalculated then the added frame may be null.
      Specified by:
      frameAdded in interface FramePriority<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
      Parameters:
      addedFrame - The newly added frame
      pendingFrames - The pending frame queue
      holdFrames - The held frame queue