public abstract class WsFrameBase
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
WsFrameBase.ReadState
WAITING - not suspended
Server case: waiting for a notification that data is ready to be read from the socket, the
socket is registered to the poller
Client case: data has been read from the socket and is waiting for data to be processed
PROCESSING - not suspended
Server case: reading from the socket and processing the data
Client case: processing the data if such has already been read and more data will be read
from the socket
SUSPENDING_WAIT - suspended, a call to suspend() was made while in WAITING state.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.nio.ByteBuffer |
inputBuffer |
protected WsSession |
wsSession |
| Constructor and Description |
|---|
WsFrameBase(WsSession wsSession,
Transformation transformation) |
| Modifier and Type | Method and Description |
|---|---|
protected static long |
byteArrayToLong(byte[] b,
int start,
int len) |
protected void |
changeReadState(WsFrameBase.ReadState newState) |
protected boolean |
changeReadState(WsFrameBase.ReadState oldState,
WsFrameBase.ReadState newState) |
protected abstract Log |
getLog() |
protected WsFrameBase.ReadState |
getReadState() |
protected Transformation |
getTransformation() |
protected abstract boolean |
isMasked() |
protected boolean |
isOpen() |
protected boolean |
isSuspended() |
protected void |
processInputBuffer() |
void |
resume() |
protected abstract void |
resumeProcessing()
This method will be invoked when the read operation is resumed.
|
protected void |
sendMessageBinary(java.nio.ByteBuffer msg,
boolean last) |
protected void |
sendMessageText(boolean last) |
void |
suspend() |
protected void |
updateStats(long payloadLength)
Hook for updating server side statistics.
|
protected final WsSession wsSession
protected final java.nio.ByteBuffer inputBuffer
public WsFrameBase(WsSession wsSession, Transformation transformation)
protected void processInputBuffer()
throws java.io.IOException
java.io.IOExceptionprotected abstract boolean isMasked()
protected abstract Log getLog()
protected void updateStats(long payloadLength)
payloadLength - Size of message payloadprotected void sendMessageText(boolean last)
throws WsIOException
WsIOExceptionprotected void sendMessageBinary(java.nio.ByteBuffer msg,
boolean last)
throws WsIOException
WsIOExceptionprotected static long byteArrayToLong(byte[] b,
int start,
int len)
throws java.io.IOException
java.io.IOExceptionprotected boolean isOpen()
protected Transformation getTransformation()
public void suspend()
public void resume()
protected boolean isSuspended()
protected WsFrameBase.ReadState getReadState()
protected void changeReadState(WsFrameBase.ReadState newState)
protected boolean changeReadState(WsFrameBase.ReadState oldState, WsFrameBase.ReadState newState)
protected abstract void resumeProcessing()
Copyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.