public abstract class WsFrameBase extends 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 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(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 ByteBuffer inputBuffer
public WsFrameBase(WsSession wsSession, Transformation transformation)
protected void processInputBuffer() throws IOException
IOException
protected abstract boolean isMasked()
protected abstract Log getLog()
protected void updateStats(long payloadLength)
payloadLength
- Size of message payloadprotected void sendMessageText(boolean last) throws WsIOException
WsIOException
protected void sendMessageBinary(ByteBuffer msg, boolean last) throws WsIOException
WsIOException
protected static long byteArrayToLong(byte[] b, int start, int len) throws IOException
IOException
protected 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-2020 Apache Software Foundation. All Rights Reserved.