org.eclipse.jetty.websocket
Class WebSocketConnectionD00
java.lang.Object
org.eclipse.jetty.io.AbstractConnection
org.eclipse.jetty.websocket.WebSocketConnectionD00
- All Implemented Interfaces:
- org.eclipse.jetty.io.Connection, WebSocket.Connection, WebSocket.FrameConnection, WebSocketConnection
public class WebSocketConnectionD00
- extends org.eclipse.jetty.io.AbstractConnection
- implements WebSocketConnection, WebSocket.FrameConnection
| Fields inherited from class org.eclipse.jetty.io.AbstractConnection |
_endp |
|
Method Summary |
byte |
binaryOpcode()
|
void |
close(int code,
String message)
|
void |
closed()
|
byte |
continuationOpcode()
|
void |
disconnect()
|
static byte[] |
doTheHixieHixieShake(long key1,
long key2,
byte[] key3)
|
void |
fillBuffersFrom(org.eclipse.jetty.io.Buffer buffer)
|
byte |
finMask()
|
List<Extension> |
getExtensions()
|
int |
getMaxBinaryMessageSize()
Size in bytes of the maximum binary message to be received |
int |
getMaxTextMessageSize()
Size in characters of the maximum text message to be received |
String |
getProtocol()
|
org.eclipse.jetty.io.Connection |
handle()
|
void |
handshake(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String origin,
String subprotocol)
|
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)
|
void |
sendFrame(byte flags,
byte opcode,
byte[] content,
int offset,
int length)
|
void |
sendMessage(byte[] data,
int offset,
int length)
|
void |
sendMessage(String content)
|
void |
setHixieKeys(String key1,
String key2)
|
void |
setMaxBinaryMessageSize(int size)
|
void |
setMaxTextMessageSize(int size)
|
byte |
textOpcode()
|
| Methods inherited from class org.eclipse.jetty.io.AbstractConnection |
getEndPoint, getTimeStamp, idleExpired, toString |
| Methods inherited from interface org.eclipse.jetty.io.Connection |
getTimeStamp, idleExpired |
LENGTH_FRAME
public static final byte LENGTH_FRAME
- See Also:
- Constant Field Values
SENTINEL_FRAME
public static final byte SENTINEL_FRAME
- See Also:
- Constant Field Values
WebSocketConnectionD00
public WebSocketConnectionD00(WebSocket websocket,
org.eclipse.jetty.io.EndPoint endpoint,
WebSocketBuffers buffers,
long timestamp,
int maxIdleTime,
String protocol)
throws IOException
- Throws:
IOException
setHixieKeys
public void setHixieKeys(String key1,
String key2)
handle
public org.eclipse.jetty.io.Connection handle()
throws IOException
- Specified by:
handle in interface org.eclipse.jetty.io.Connection
- Throws:
IOException
isOpen
public boolean isOpen()
- Specified by:
isOpen in interface WebSocket.Connection
isIdle
public boolean isIdle()
- Specified by:
isIdle in interface org.eclipse.jetty.io.Connection
isSuspended
public boolean isSuspended()
- Specified by:
isSuspended in interface org.eclipse.jetty.io.Connection
closed
public void closed()
- Specified by:
closed in interface org.eclipse.jetty.io.Connection
sendMessage
public void sendMessage(String content)
throws IOException
- Specified by:
sendMessage in interface WebSocket.Connection
- Throws:
IOException
sendMessage
public void sendMessage(byte[] data,
int offset,
int length)
throws IOException
- Specified by:
sendMessage in interface WebSocket.Connection
- Throws:
IOException
isMore
public boolean isMore(byte flags)
sendControl
public void sendControl(byte code,
byte[] content,
int offset,
int length)
throws IOException
-
- Specified by:
sendControl in interface WebSocket.FrameConnection
- Throws:
IOException
sendFrame
public void sendFrame(byte flags,
byte opcode,
byte[] content,
int offset,
int length)
throws IOException
- Specified by:
sendFrame in interface WebSocket.FrameConnection
- Throws:
IOException
close
public void close(int code,
String message)
- Specified by:
close in interface WebSocket.FrameConnection
disconnect
public void disconnect()
- Specified by:
disconnect in interface WebSocket.Connection
fillBuffersFrom
public void fillBuffersFrom(org.eclipse.jetty.io.Buffer buffer)
- Specified by:
fillBuffersFrom in interface WebSocketConnection
doTheHixieHixieShake
public static byte[] doTheHixieHixieShake(long key1,
long key2,
byte[] key3)
handshake
public void handshake(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String origin,
String subprotocol)
throws IOException
- Specified by:
handshake in interface WebSocketConnection
- Throws:
IOException
setMaxTextMessageSize
public void setMaxTextMessageSize(int size)
- Specified by:
setMaxTextMessageSize in interface WebSocket.Connection
- Parameters:
size - size<0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characters
setMaxBinaryMessageSize
public void setMaxBinaryMessageSize(int size)
- Specified by:
setMaxBinaryMessageSize in interface WebSocket.Connection
- Parameters:
size - size<0 no aggregation of binary frames, >=0 size of binary frame aggregation buffer
getMaxTextMessageSize
public int getMaxTextMessageSize()
- Description copied from interface:
WebSocket.Connection
- Size in characters of the maximum text message to be received
- Specified by:
getMaxTextMessageSize in interface WebSocket.Connection
- Returns:
- size <0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characters
getMaxBinaryMessageSize
public int getMaxBinaryMessageSize()
- Description copied from interface:
WebSocket.Connection
- Size in bytes of the maximum binary message to be received
- Specified by:
getMaxBinaryMessageSize in interface WebSocket.Connection
- Returns:
- size <0 no aggregation of binary frames, >=0 size of binary frame aggregation buffer
getProtocol
public String getProtocol()
- Specified by:
getProtocol in interface WebSocket.Connection
isMessageComplete
public boolean isMessageComplete(byte flags)
- Specified by:
isMessageComplete in interface WebSocket.FrameConnection
binaryOpcode
public byte binaryOpcode()
- Specified by:
binaryOpcode in interface WebSocket.FrameConnection
textOpcode
public byte textOpcode()
- Specified by:
textOpcode in interface WebSocket.FrameConnection
isControl
public boolean isControl(byte opcode)
- Specified by:
isControl in interface WebSocket.FrameConnection
isText
public boolean isText(byte opcode)
- Specified by:
isText in interface WebSocket.FrameConnection
isBinary
public boolean isBinary(byte opcode)
- Specified by:
isBinary in interface WebSocket.FrameConnection
isContinuation
public boolean isContinuation(byte opcode)
- Specified by:
isContinuation in interface WebSocket.FrameConnection
isClose
public boolean isClose(byte opcode)
- Specified by:
isClose in interface WebSocket.FrameConnection
isPing
public boolean isPing(byte opcode)
- Specified by:
isPing in interface WebSocket.FrameConnection
isPong
public boolean isPong(byte opcode)
- Specified by:
isPong in interface WebSocket.FrameConnection
getExtensions
public List<Extension> getExtensions()
- Specified by:
getExtensions in interface WebSocketConnection
continuationOpcode
public byte continuationOpcode()
- Specified by:
continuationOpcode in interface WebSocket.FrameConnection
finMask
public byte finMask()
- Specified by:
finMask in interface WebSocket.FrameConnection
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.