org.eclipse.jetty.io.Connection that is suitable for WebSocket
| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufferPool | |
| private final LongAdder | |
| private final WebSocketCoreSession | |
| private WebSocketConnection. | |
| private boolean | |
| private final WebSocketConnection. | |
| private final Generator | |
| private final AutoLock | |
| private static final Logger | |
| private final LongAdder | |
| private static final int | MIN_BUFFER_SIZE
Minimum size of a buffer is the determined to be what would be the maximum framing header size (not including payload) |
| private RetainableByteBuffer | |
| private final Parser | |
| private final Random | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | WebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, WebSocketCoreSession coreSession)
Create a WSConnection. |
| public | WebSocketConnection(EndPoint
The endpoint ever which Websockot is sent/received endp, Executor A thread executor to use for WS callbacks. executor, Scheduler A scheduler to use for timeouts scheduler, ByteBufferPool A pool of retainable buffers to use. byteBufferPool, WebSocketCoreSession The WC core session to which frames are delivered. coreSession, Random A Random used to mask frames. If null then SecureRandom will be created if needed. randomMask)Create a WSConnection. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | |
| public void | |
| public String | |
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Implements org. Dump this object (and children) into an Appendable using the provided indent after any new lines. |
| public void | enqueueFrame(Frame
The frame to queue frame, Callback The callback to call once the frame is sent callback, boolean True if batch mode is to be used batch)Enqueue a Frame to be sent. |
| private void | |
| public long | getBytesIn()
Overrides org. Implements org.
|
| public long | |
| public Executor | |
| public InetSocketAddress | getLocalAddress()
Deprecated
use
getLocalSocketAddress() instead
Returns: the local InetSocketAddress |
| public SocketAddress | |
| public long | |
| public long | |
| public InetSocketAddress | getRemoteAddress()
Deprecated
use
getRemoteSocketAddress() instead
Returns: the remote InetSocketAddress |
| public SocketAddress | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| private RetainableByteBuffer | |
| public void | onClose(Throwable
The cause of the close or null for a normal close cause)Overrides org. Implements org. Physical connection disconnect. |
| public void | onFillable()
Implements abstract org. Callback method invoked when the endpoint is ready to be read. |
| protected void | |
| public boolean | onIdleExpired(TimeoutException timeoutException)
Overrides org. Implements org. Callback method invoked upon an idle timeout event. |
| public void | onOpen()
Overrides org. Implements org. Physical connection Open. |
| protected boolean | Returns: true to signal that the endpoint must be closed, false to keep the endpoint openthe cause of the read timeout timeout)Overrides org. Event for no activity on connection (read or write) |
| public void | onUpgradeTo(ByteBuffer
a non-null buffer of extra bytes buffer)Implements org. Extra bytes from the initial HTTP upgrade that need to be processed by the websocket parser before starting to read bytes from the connection |
| private void | |
| private void | |
| public void | |
| protected void | setInitialBuffer(ByteBuffer
the bytes of extra content encountered during upgrade initialBuffer)Extra bytes from the initial HTTP upgrade that need to be processed by the websocket parser before starting to read bytes from the connection |
| public void | setInputBufferSize(int inputBufferSize)
Overrides org.
|
| public void | |
| public void | |
| public void | |
| public String |
| byteBufferPool | back to summary |
|---|---|
| private final ByteBufferPool byteBufferPool | |
| bytesIn | back to summary |
|---|---|
| private final LongAdder bytesIn | |
| coreSession | back to summary |
|---|---|
| private final WebSocketCoreSession coreSession | |
| demand | back to summary |
|---|---|
| private WebSocketConnection. | |
| fillingAndParsing | back to summary |
|---|---|
| private boolean fillingAndParsing | |
| flusher | back to summary |
|---|---|
| private final WebSocketConnection. | |
| generator | back to summary |
|---|---|
| private final Generator generator | |
| lock | back to summary |
|---|---|
| private final AutoLock lock | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| messagesIn | back to summary |
|---|---|
| private final LongAdder messagesIn | |
| MIN_BUFFER_SIZE | back to summary |
|---|---|
| private static final int MIN_BUFFER_SIZE Minimum size of a buffer is the determined to be what would be the maximum framing header size (not including payload) | |
| networkBuffer | back to summary |
|---|---|
| private RetainableByteBuffer networkBuffer | |
| parser | back to summary |
|---|---|
| private final Parser parser | |
| random | back to summary |
|---|---|
| private final Random random | |
| useInputDirectByteBuffers | back to summary |
|---|---|
| private boolean useInputDirectByteBuffers | |
| useOutputDirectByteBuffers | back to summary |
|---|---|
| private boolean useOutputDirectByteBuffers | |
| WebSocketConnection | back to summary |
|---|---|
| public WebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, WebSocketCoreSession coreSession) Create a WSConnection. It is assumed that the WebSocket Upgrade Handshake has already completed successfully before creating this connection. | |
| WebSocketConnection | back to summary |
|---|---|
| public WebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, WebSocketCoreSession coreSession, Random randomMask) Create a WSConnection. It is assumed that the WebSocket Upgrade Handshake has already completed successfully before creating this connection.
| |
| acquireNetworkBuffer | back to summary |
|---|---|
| private void acquireNetworkBuffer() | |
| cancelDemand | back to summary |
|---|---|
| public void cancelDemand() | |
| demand | back to summary |
|---|---|
| public void demand() | |
| dump | back to summary |
|---|---|
| public String dump() Overrides default org.
| |
| dump | back to summary |
|---|---|
| public void dump(Appendable out, String indent) throws IOException Implements org. Doc from org. Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
| |
| enqueueFrame | back to summary |
|---|---|
| public void enqueueFrame(Frame frame, Callback callback, boolean batch) Enqueue a Frame to be sent. | |
| fillAndParse | back to summary |
|---|---|
| private void fillAndParse() | |
| getBytesIn | back to summary |
|---|---|
| public long getBytesIn() Overrides org. Implements org.
| |
| getBytesOut | back to summary |
|---|---|
| public long getBytesOut() Overrides org. Implements org.
| |
| getExecutor | back to summary |
|---|---|
| public Executor getExecutor() Overrides org.
| |
| getLocalAddress | back to summary |
|---|---|
| public InetSocketAddress getLocalAddress()
Deprecated use
| |
| getLocalSocketAddress | back to summary |
|---|---|
| public SocketAddress getLocalSocketAddress() | |
| getMessagesIn | back to summary |
|---|---|
| public long getMessagesIn() Overrides org. Implements org.
| |
| getMessagesOut | back to summary |
|---|---|
| public long getMessagesOut() Overrides org. Implements org.
| |
| getRemoteAddress | back to summary |
|---|---|
| public InetSocketAddress getRemoteAddress()
Deprecated use
| |
| getRemoteSocketAddress | back to summary |
|---|---|
| public SocketAddress getRemoteSocketAddress() | |
| isUseInputDirectByteBuffers | back to summary |
|---|---|
| public boolean isUseInputDirectByteBuffers() | |
| isUseOutputDirectByteBuffers | back to summary |
|---|---|
| public boolean isUseOutputDirectByteBuffers() | |
| meetDemand | back to summary |
|---|---|
| public boolean meetDemand() | |
| moreDemand | back to summary |
|---|---|
| public boolean moreDemand() | |
| newNetworkBuffer | back to summary |
|---|---|
| private RetainableByteBuffer newNetworkBuffer(int capacity) | |
| onClose | back to summary |
|---|---|
| public void onClose(Throwable cause) Overrides org. Implements org. Physical connection disconnect. Not related to WebSocket close handshake.
| |
| onFillable | back to summary |
|---|---|
| public void onFillable() Implements abstract org. Doc from org. Callback method invoked when the endpoint is ready to be read.
| |
| onFrame | back to summary |
|---|---|
| protected void onFrame(Frame. | |
| onIdleExpired | back to summary |
|---|---|
| public boolean onIdleExpired(TimeoutException timeoutException) Overrides org. Implements org. Doc from org. Callback method invoked upon an idle timeout event. Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed. When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
| |
| onOpen | back to summary |
|---|---|
| public void onOpen() Overrides org. Implements org. Physical connection Open.
| |
| onReadTimeout | back to summary |
|---|---|
| protected boolean onReadTimeout(TimeoutException timeout) Overrides org. Event for no activity on connection (read or write)
| |
| onUpgradeTo | back to summary |
|---|---|
| public void onUpgradeTo(ByteBuffer buffer) Implements org. Extra bytes from the initial HTTP upgrade that need to be processed by the websocket parser before starting to read bytes from the connection
| |
| reacquireNetworkBuffer | back to summary |
|---|---|
| private void reacquireNetworkBuffer() | |
| releaseNetworkBuffer | back to summary |
|---|---|
| private void releaseNetworkBuffer() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| setInitialBuffer | back to summary |
|---|---|
| protected void setInitialBuffer(ByteBuffer initialBuffer) Extra bytes from the initial HTTP upgrade that need to be processed by the websocket parser before starting to read bytes from the connection
| |
| setInputBufferSize | back to summary |
|---|---|
| public void setInputBufferSize(int inputBufferSize) Overrides org.
| |
| setUseInputDirectByteBuffers | back to summary |
|---|---|
| public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers) | |
| setUseOutputDirectByteBuffers | back to summary |
|---|---|
| public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers) | |
| setWriteTimeout | back to summary |
|---|---|
| public void setWriteTimeout(long writeTimeout) | |
| toConnectionString | back to summary |
|---|---|
| public String toConnectionString() Overrides org.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final WebSocketConnection. | |
| public static final WebSocketConnection. | |
| public static final WebSocketConnection. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static WebSocketConnection. | |
| public static WebSocketConnection. |
| CANCELLED | back to summary |
|---|---|
| public static final WebSocketConnection. | |
| DEMANDING | back to summary |
|---|---|
| public static final WebSocketConnection. | |
| NOT_DEMANDING | back to summary |
|---|---|
| public static final WebSocketConnection. | |
| DemandState | back to summary |
|---|---|
| private DemandState() | |
| valueOf | back to summary |
|---|---|
| public static WebSocketConnection. | |
| values | back to summary |
|---|---|
| public static WebSocketConnection. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | onCompleteFailure(Throwable
the throwable to indicate cause of failure x)Overrides org. Invoked when the overall task has completed with a failure. |
| Flusher | back to summary |
|---|---|
| private Flusher(Scheduler scheduler, int bufferSize, Generator generator, EndPoint endpoint) | |
| onCompleteFailure | back to summary |
|---|---|
| public void onCompleteFailure(Throwable x) Overrides org. Doc from org. Invoked when the overall task has completed with a failure. | |