public static interface WebSocket.FrameConnection extends WebSocket.Connection
The Connection interface at the level of sending/receiving frames rather than messages. Also contains methods to decode/generate flags and opcodes without using constants, so that code can be written to work with multiple drafts of the protocol.
Modifier and Type | Method and Description |
---|---|
byte |
binaryOpcode() |
byte |
continuationOpcode() |
byte |
finMask() |
boolean |
isAllowFrameFragmentation() |
boolean |
isBinary(byte opcode) |
boolean |
isClose(byte opcode) |
boolean |
isContinuation(byte opcode) |
boolean |
isControl(byte opcode) |
boolean |
isMessageComplete(byte flags) |
boolean |
isPing(byte opcode) |
boolean |
isPong(byte opcode) |
boolean |
isText(byte opcode) |
void |
sendControl(byte control,
byte[] data,
int offset,
int length)
Send a control frame
|
void |
sendFrame(byte flags,
byte opcode,
byte[] data,
int offset,
int length)
Send an arbitrary frame
|
void |
setAllowFrameFragmentation(boolean allowFragmentation)
Set if frames larger than the frame buffer are handled with local fragmentations
|
byte |
textOpcode() |
close, close, disconnect, getMaxBinaryMessageSize, getMaxIdleTime, getMaxTextMessageSize, getProtocol, isOpen, sendMessage, sendMessage, setMaxBinaryMessageSize, setMaxIdleTime, setMaxTextMessageSize
byte binaryOpcode()
byte textOpcode()
byte continuationOpcode()
byte finMask()
void setAllowFrameFragmentation(boolean allowFragmentation)
allowFragmentation
- boolean isMessageComplete(byte flags)
flags
- The flags bytes of a frameboolean isControl(byte opcode)
opcode
- boolean isText(byte opcode)
opcode
- boolean isBinary(byte opcode)
opcode
- boolean isContinuation(byte opcode)
opcode
- boolean isClose(byte opcode)
opcode
- boolean isPing(byte opcode)
opcode
- boolean isPong(byte opcode)
opcode
- boolean isAllowFrameFragmentation()
void sendControl(byte control, byte[] data, int offset, int length) throws IOException
control
- data
- offset
- length
- IOException
void sendFrame(byte flags, byte opcode, byte[] data, int offset, int length) throws IOException
flags
- opcode
- data
- offset
- length
- IOException
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.