Top Description Fields Constructors Methods
io.undertow.websockets.core

public Class WebSocketFramePriority

extends Object
implements FramePriority<WebSocketChannel, StreamSourceFrameChannel, StreamSinkFrameChannel>
Class Inheritance
All Implemented Interfaces
io.undertow.server.protocol.framed.FramePriority
Imports
io.undertow.server.protocol.framed.FramePriority, java.util.Deque, .List, .Queue, java.util.concurrent.ConcurrentLinkedDeque

Web socket frame priority
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
pack-priv boolean
private StreamSinkFrameChannel
pack-priv boolean
private final Queue<StreamSinkFrameChannel>
strictOrderQueue

Strict ordering queue.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public void
frameAdded(StreamSinkFrameChannel
The newly added frame
addedFrame
,
List<StreamSinkFrameChannel>
The pending frame queue
pendingFrames
,
Deque<StreamSinkFrameChannel>
The held frame queue
holdFrames
)

Implements io.undertow.server.protocol.framed.FramePriority.frameAdded.

Invoked when a new frame is successfully added to the pending frames queue.

pack-priv void
public boolean
insertFrame(StreamSinkFrameChannel
The new frame to insert into the pending frame list
newFrame
,
List<StreamSinkFrameChannel>
The pending frame list
pendingFrames
)

Implements io.undertow.server.protocol.framed.FramePriority.insertFrame.

Inserts the new frame at the correct location in the pending frame list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
pack-priv boolean closed
currentFragmentedSenderback to summary
private StreamSinkFrameChannel currentFragmentedSender
immediateCloseFrameback to summary
pack-priv boolean immediateCloseFrame
strictOrderQueueback to summary
private final Queue<StreamSinkFrameChannel> strictOrderQueue

Strict ordering queue. Makes sure that the initial frame for a stream is sent in the order that send() is called.

Required to pass the autobahn test suite with no non-strict performance.

Todo

provide a way to disable this.

Constructor Detail

WebSocketFramePriorityback to summary
public WebSocketFramePriority()

Method Detail

addToOrderQueueback to summary
pack-priv void addToOrderQueue(final StreamSinkFrameChannel channel)
frameAddedback to summary
public void frameAdded(StreamSinkFrameChannel addedFrame, List<StreamSinkFrameChannel> pendingFrames, Deque<StreamSinkFrameChannel> holdFrames)

Implements io.undertow.server.protocol.framed.FramePriority.frameAdded.

Doc from io.undertow.server.protocol.framed.FramePriority.frameAdded.

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.

Parameters
addedFrame:StreamSinkFrameChannel

The newly added frame

pendingFrames:List<StreamSinkFrameChannel>

The pending frame queue

holdFrames:Deque<StreamSinkFrameChannel>

The held frame queue

Annotations
@Override
immediateCloseFrameback to summary
pack-priv void immediateCloseFrame()
insertFrameback to summary
public boolean insertFrame(StreamSinkFrameChannel newFrame, List<StreamSinkFrameChannel> pendingFrames)

Implements io.undertow.server.protocol.framed.FramePriority.insertFrame.

Doc from io.undertow.server.protocol.framed.FramePriority.insertFrame.

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.

Parameters
newFrame:StreamSinkFrameChannel

The new frame to insert into the pending frame list

pendingFrames:List<StreamSinkFrameChannel>

The pending frame list

Returns:boolean

true if the frame can be inserted into the pending frame list

Annotations
@Override