Package org.eclipse.net4j.ws.jetty
Class Net4jWebSocket
java.lang.Object
org.eclipse.net4j.ws.jetty.Net4jWebSocket
- All Implemented Interfaces:
org.eclipse.jetty.websocket.api.WebSocketConnectionListener
,org.eclipse.jetty.websocket.api.WebSocketListener
public class Net4jWebSocket
extends Object
implements org.eclipse.jetty.websocket.api.WebSocketListener
- Author:
- Eike Stepper
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
static final byte
static final byte
static final byte
static final byte
-
Constructor Summary
ConstructorDescriptionCalled byNet4jWebSocketServlet
.Net4jWebSocket
(IWSConnector connector) Called byWSClientConnector
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
deregisterChannel
(short channelID) org.eclipse.jetty.websocket.api.Session
boolean
isClient()
void
onWebSocketBinary
(byte[] payload, int offset, int len) void
onWebSocketClose
(int statusCode, String reason) void
onWebSocketConnect
(org.eclipse.jetty.websocket.api.Session session) void
onWebSocketError
(Throwable cause) void
onWebSocketText
(String message) void
registerChannel
(short channelID, long timeout, IProtocol<?> protocol) void
sendBuffer
(IBuffer buffer)
-
Field Details
-
CONTROL_CHANNEL_ID
public static final short CONTROL_CHANNEL_ID- See Also:
-
OPCODE_NEGOTIATION
public static final byte OPCODE_NEGOTIATION- See Also:
-
OPCODE_REGISTRATION
public static final byte OPCODE_REGISTRATION- See Also:
-
OPCODE_REGISTRATION_ACK
public static final byte OPCODE_REGISTRATION_ACK- See Also:
-
OPCODE_DEREGISTRATION
public static final byte OPCODE_DEREGISTRATION- See Also:
-
-
Constructor Details
-
Net4jWebSocket
public Net4jWebSocket()Called byNet4jWebSocketServlet
. -
Net4jWebSocket
Called byWSClientConnector
.
-
-
Method Details
-
getConnector
-
getSession
public org.eclipse.jetty.websocket.api.Session getSession()- Since:
- 1.1
-
isClient
public boolean isClient() -
onWebSocketConnect
public void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session) - Specified by:
onWebSocketConnect
in interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
close
public void close() -
onWebSocketClose
- Specified by:
onWebSocketClose
in interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
registerChannel
public void registerChannel(short channelID, long timeout, IProtocol<?> protocol) throws IOException - Throws:
IOException
-
deregisterChannel
- Throws:
IOException
-
sendBuffer
-
onWebSocketBinary
public void onWebSocketBinary(byte[] payload, int offset, int len) - Specified by:
onWebSocketBinary
in interfaceorg.eclipse.jetty.websocket.api.WebSocketListener
-
onWebSocketText
- Specified by:
onWebSocketText
in interfaceorg.eclipse.jetty.websocket.api.WebSocketListener
-
onWebSocketError
- Specified by:
onWebSocketError
in interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-