org.eclipse.jetty.websocket
Class WebSocketConnectionRFC6455
java.lang.Object
org.eclipse.jetty.io.AbstractConnection
org.eclipse.jetty.websocket.WebSocketConnectionRFC6455
- All Implemented Interfaces:
- Connection, AsyncConnection, WebSocketConnection
- Direct Known Subclasses:
- WebSocketServletConnectionRFC6455
public class WebSocketConnectionRFC6455
- extends AbstractConnection
- implements WebSocketConnection
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-------+-+-------------+-------------------------------+
|F|R|R|R| opcode|M| Payload len | Extended payload length |
|I|S|S|S| (4) |A| (7) | (16/64) |
|N|V|V|V| |S| | (if payload len==126/127) |
| |1|2|3| |K| | |
+-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +
| Extended payload length continued, if payload len == 127 |
+ - - - - - - - - - - - - - - - +-------------------------------+
| |Masking-key, if MASK set to 1 |
+-------------------------------+-------------------------------+
| Masking-key (continued) | Payload Data |
+-------------------------------- - - - - - - - - - - - - - - - +
: Payload Data continued ... :
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
| Payload Data continued ... |
+---------------------------------------------------------------+
Constructor Summary |
WebSocketConnectionRFC6455(WebSocket websocket,
EndPoint endpoint,
WebSocketBuffers buffers,
long timestamp,
int maxIdleTime,
String protocol,
List<Extension> extensions,
int draft)
|
WebSocketConnectionRFC6455(WebSocket websocket,
EndPoint endpoint,
WebSocketBuffers buffers,
long timestamp,
int maxIdleTime,
String protocol,
List<Extension> extensions,
int draft,
MaskGen maskgen)
|
WebSocketConnectionRFC6455
public WebSocketConnectionRFC6455(WebSocket websocket,
EndPoint endpoint,
WebSocketBuffers buffers,
long timestamp,
int maxIdleTime,
String protocol,
List<Extension> extensions,
int draft)
throws IOException
- Throws:
IOException
WebSocketConnectionRFC6455
public WebSocketConnectionRFC6455(WebSocket websocket,
EndPoint endpoint,
WebSocketBuffers buffers,
long timestamp,
int maxIdleTime,
String protocol,
List<Extension> extensions,
int draft,
MaskGen maskgen)
throws IOException
- Throws:
IOException
getConnection
public WebSocket.Connection getConnection()
- Specified by:
getConnection
in interface WebSocketConnection
getExtensions
public List<Extension> getExtensions()
- Specified by:
getExtensions
in interface WebSocketConnection
handle
public Connection handle()
throws IOException
- Description copied from interface:
Connection
- Handle the connection.
- Specified by:
handle
in interface Connection
- Returns:
- The Connection to use for the next handling of the connection.
This allows protocol upgrades and support for CONNECT.
- Throws:
IOException
onInputShutdown
public void onInputShutdown()
throws IOException
- Specified by:
onInputShutdown
in interface AsyncConnection
- Throws:
IOException
isIdle
public boolean isIdle()
- Specified by:
isIdle
in interface Connection
onIdleExpired
public void onIdleExpired(long idleForMs)
- Description copied from interface:
Connection
- Called when the connection idle timeout expires
- Specified by:
onIdleExpired
in interface Connection
- Overrides:
onIdleExpired
in class AbstractConnection
- Parameters:
idleForMs
- TODO
isSuspended
public boolean isSuspended()
- Specified by:
isSuspended
in interface Connection
onClose
public void onClose()
- Description copied from interface:
Connection
- Called when the connection is closed
- Specified by:
onClose
in interface Connection
closeIn
public void closeIn(int code,
String message)
closeOut
public void closeOut(int code,
String message)
shutdown
public void shutdown()
- Specified by:
shutdown
in interface WebSocketConnection
fillBuffersFrom
public void fillBuffersFrom(Buffer buffer)
- Specified by:
fillBuffersFrom
in interface WebSocketConnection
onFrameHandshake
protected void onFrameHandshake()
onWebSocketOpen
protected void onWebSocketOpen()
hashKey
public static String hashKey(String key)
toString
public String toString()
- Overrides:
toString
in class AbstractConnection
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.