|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.io.AbstractConnection org.eclipse.jetty.websocket.WebSocketConnectionD00
public class WebSocketConnectionD00
Field Summary | |
---|---|
static byte |
LENGTH_FRAME
|
static byte |
SENTINEL_FRAME
|
Fields inherited from class org.eclipse.jetty.io.AbstractConnection |
---|
_endp |
Constructor Summary | |
---|---|
WebSocketConnectionD00(WebSocket websocket,
EndPoint endpoint,
WebSocketBuffers buffers,
long timestamp,
int maxIdleTime,
String protocol)
|
Method Summary | |
---|---|
byte |
binaryOpcode()
|
void |
close(int code,
String message)
Close the connection with specific closeCode and message. |
void |
closed()
Called when the connection is closed |
byte |
continuationOpcode()
|
void |
disconnect()
|
static byte[] |
doTheHixieHixieShake(long key1,
long key2,
byte[] key3)
|
void |
fillBuffersFrom(Buffer buffer)
|
byte |
finMask()
|
WebSocket.Connection |
getConnection()
|
List<Extension> |
getExtensions()
|
int |
getMaxBinaryMessageSize()
Size in bytes of the maximum binary message to be received |
int |
getMaxIdleTime()
|
int |
getMaxTextMessageSize()
Size in characters of the maximum text message to be received |
String |
getProtocol()
|
Connection |
handle()
Handle the connection. |
void |
handshake(HttpServletRequest request,
HttpServletResponse response,
String subprotocol)
|
boolean |
isAllowFrameFragmentation()
|
boolean |
isBinary(byte opcode)
|
boolean |
isClose(byte opcode)
|
boolean |
isContinuation(byte opcode)
|
boolean |
isControl(byte opcode)
|
boolean |
isIdle()
|
boolean |
isMessageComplete(byte flags)
|
boolean |
isMore(byte flags)
|
boolean |
isOpen()
|
boolean |
isPing(byte opcode)
|
boolean |
isPong(byte opcode)
|
boolean |
isSuspended()
|
boolean |
isText(byte opcode)
|
void |
sendControl(byte code,
byte[] content,
int offset,
int length)
Send a control frame |
void |
sendFrame(byte flags,
byte opcode,
byte[] content,
int offset,
int length)
Send an arbitrary frame |
void |
sendMessage(byte[] data,
int offset,
int length)
|
void |
sendMessage(String content)
|
void |
setAllowFrameFragmentation(boolean allowFragmentation)
Set if frames larger than the frame buffer are handled with local fragmentations |
void |
setHixieKeys(String key1,
String key2)
|
void |
setMaxBinaryMessageSize(int size)
|
void |
setMaxIdleTime(int ms)
|
void |
setMaxTextMessageSize(int size)
|
byte |
textOpcode()
|
Methods inherited from class org.eclipse.jetty.io.AbstractConnection |
---|
getEndPoint, getTimeStamp, idleExpired, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.jetty.io.Connection |
---|
getTimeStamp, idleExpired |
Field Detail |
---|
public static final byte LENGTH_FRAME
public static final byte SENTINEL_FRAME
Constructor Detail |
---|
public WebSocketConnectionD00(WebSocket websocket, EndPoint endpoint, WebSocketBuffers buffers, long timestamp, int maxIdleTime, String protocol) throws IOException
IOException
Method Detail |
---|
public WebSocket.Connection getConnection()
getConnection
in interface WebSocketConnection
public void setHixieKeys(String key1, String key2)
public Connection handle() throws IOException
Connection
handle
in interface Connection
IOException
public boolean isOpen()
isOpen
in interface WebSocket.Connection
public boolean isIdle()
isIdle
in interface Connection
public boolean isSuspended()
isSuspended
in interface Connection
public void closed()
Connection
closed
in interface Connection
public void sendMessage(String content) throws IOException
sendMessage
in interface WebSocket.Connection
IOException
public void sendMessage(byte[] data, int offset, int length) throws IOException
sendMessage
in interface WebSocket.Connection
IOException
public boolean isMore(byte flags)
public void sendControl(byte code, byte[] content, int offset, int length) throws IOException
sendControl
in interface WebSocket.FrameConnection
IOException
public void sendFrame(byte flags, byte opcode, byte[] content, int offset, int length) throws IOException
WebSocket.FrameConnection
sendFrame
in interface WebSocket.FrameConnection
IOException
public void close(int code, String message)
WebSocket.FrameConnection
close
in interface WebSocket.FrameConnection
public void disconnect()
disconnect
in interface WebSocket.Connection
public void fillBuffersFrom(Buffer buffer)
fillBuffersFrom
in interface WebSocketConnection
public static byte[] doTheHixieHixieShake(long key1, long key2, byte[] key3)
public void handshake(HttpServletRequest request, HttpServletResponse response, String subprotocol) throws IOException
handshake
in interface WebSocketConnection
IOException
public void setMaxTextMessageSize(int size)
setMaxTextMessageSize
in interface WebSocket.Connection
size
- size<0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characterspublic void setMaxIdleTime(int ms)
setMaxIdleTime
in interface WebSocket.Connection
ms
- The time in ms that the connection can be idle before closingpublic void setMaxBinaryMessageSize(int size)
setMaxBinaryMessageSize
in interface WebSocket.Connection
size
- size<0 no aggregation of binary frames, >=0 size of binary frame aggregation bufferpublic int getMaxTextMessageSize()
WebSocket.Connection
getMaxTextMessageSize
in interface WebSocket.Connection
public int getMaxIdleTime()
getMaxIdleTime
in interface WebSocket.Connection
public int getMaxBinaryMessageSize()
WebSocket.Connection
getMaxBinaryMessageSize
in interface WebSocket.Connection
public String getProtocol()
getProtocol
in interface WebSocket.Connection
public boolean isMessageComplete(byte flags)
isMessageComplete
in interface WebSocket.FrameConnection
flags
- The flags bytes of a frame
public byte binaryOpcode()
binaryOpcode
in interface WebSocket.FrameConnection
public byte textOpcode()
textOpcode
in interface WebSocket.FrameConnection
public boolean isControl(byte opcode)
isControl
in interface WebSocket.FrameConnection
public boolean isText(byte opcode)
isText
in interface WebSocket.FrameConnection
public boolean isBinary(byte opcode)
isBinary
in interface WebSocket.FrameConnection
public boolean isContinuation(byte opcode)
isContinuation
in interface WebSocket.FrameConnection
public boolean isClose(byte opcode)
isClose
in interface WebSocket.FrameConnection
public boolean isPing(byte opcode)
isPing
in interface WebSocket.FrameConnection
public boolean isPong(byte opcode)
isPong
in interface WebSocket.FrameConnection
public List<Extension> getExtensions()
getExtensions
in interface WebSocketConnection
public byte continuationOpcode()
continuationOpcode
in interface WebSocket.FrameConnection
public byte finMask()
finMask
in interface WebSocket.FrameConnection
public void setAllowFrameFragmentation(boolean allowFragmentation)
WebSocket.FrameConnection
setAllowFrameFragmentation
in interface WebSocket.FrameConnection
public boolean isAllowFrameFragmentation()
isAllowFrameFragmentation
in interface WebSocket.FrameConnection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |