org.eclipse.jetty.websocket
接口 WebSocket.FrameConnection

所有超级接口:
WebSocket.Connection
所有已知实现类:
WebSocketConnectionD00, WebSocketServletConnectionD00
正在封闭接口:
WebSocket

public static interface WebSocket.FrameConnection
extends WebSocket.Connection

Frame Level 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.


方法摘要
 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()
           
 
从接口 org.eclipse.jetty.websocket.WebSocket.Connection 继承的方法
close, close, disconnect, getMaxBinaryMessageSize, getMaxIdleTime, getMaxTextMessageSize, getProtocol, isOpen, sendMessage, sendMessage, setMaxBinaryMessageSize, setMaxIdleTime, setMaxTextMessageSize
 

方法详细信息

binaryOpcode

byte binaryOpcode()
返回:
The opcode of a binary message

textOpcode

byte textOpcode()
返回:
The opcode of a text message

continuationOpcode

byte continuationOpcode()
返回:
The opcode of a continuation frame

finMask

byte finMask()
返回:
Mask for the FIN bit.

setAllowFrameFragmentation

void setAllowFrameFragmentation(boolean allowFragmentation)
Set if frames larger than the frame buffer are handled with local fragmentations

参数:
allowFragmentation -

isMessageComplete

boolean isMessageComplete(byte flags)
参数:
flags - The flags bytes of a frame
返回:
True of the flags indicate a final frame.

isControl

boolean isControl(byte opcode)
参数:
opcode -
返回:
True if the opcode is for a control frame

isText

boolean isText(byte opcode)
参数:
opcode -
返回:
True if the opcode is for a text frame

isBinary

boolean isBinary(byte opcode)
参数:
opcode -
返回:
True if the opcode is for a binary frame

isContinuation

boolean isContinuation(byte opcode)
参数:
opcode -
返回:
True if the opcode is for a continuation frame

isClose

boolean isClose(byte opcode)
参数:
opcode -
返回:
True if the opcode is a close control

isPing

boolean isPing(byte opcode)
参数:
opcode -
返回:
True if the opcode is a ping control

isPong

boolean isPong(byte opcode)
参数:
opcode -
返回:
True if the opcode is a pong control

isAllowFrameFragmentation

boolean isAllowFrameFragmentation()
返回:
True if frames larger than the frame buffer are fragmented.

sendControl

void sendControl(byte control,
                 byte[] data,
                 int offset,
                 int length)
                 throws IOException
Send a control frame

参数:
control -
data -
offset -
length -
抛出:
IOException

sendFrame

void sendFrame(byte flags,
               byte opcode,
               byte[] data,
               int offset,
               int length)
               throws IOException
Send an arbitrary frame

参数:
flags -
opcode -
data -
offset -
length -
抛出:
IOException


Copyright © 2013. All Rights Reserved.