public final class JettyWebSocketHandler extends EngineIoWebSocket implements org.eclipse.jetty.websocket.api.WebSocketListener
Emitter.Listener| Constructor and Description |
|---|
JettyWebSocketHandler(EngineIoServer server) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the WebSocket.
|
Map<String,List<String>> |
getConnectionHeaders()
Get the headers in the initial HTTP request.
|
Map<String,String> |
getQuery()
Get the query of the initial HTTP request.
|
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 |
write(byte[] message)
Write a byte array to the WebSocket and send to remote client.
|
void |
write(String message)
Write a string to the WebSocket and send to remote client.
|
public JettyWebSocketHandler(EngineIoServer server)
public Map<String,String> getQuery()
EngineIoWebSocketgetQuery in class EngineIoWebSocketpublic Map<String,List<String>> getConnectionHeaders()
EngineIoWebSocketgetConnectionHeaders in class EngineIoWebSocketpublic void write(String message) throws IOException
EngineIoWebSocketwrite in class EngineIoWebSocketmessage - String payload to send.IOException - On write error.public void write(byte[] message)
throws IOException
EngineIoWebSocketwrite in class EngineIoWebSocketmessage - Binary payload to send.IOException - On write error.public void close()
EngineIoWebSocketclose in class EngineIoWebSocketpublic void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)
onWebSocketConnect in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListenerpublic void onWebSocketClose(int statusCode,
String reason)
onWebSocketClose in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListenerpublic void onWebSocketError(Throwable cause)
onWebSocketError in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListenerpublic void onWebSocketBinary(byte[] payload,
int offset,
int len)
onWebSocketBinary in interface org.eclipse.jetty.websocket.api.WebSocketListenerpublic void onWebSocketText(String message)
onWebSocketText in interface org.eclipse.jetty.websocket.api.WebSocketListenerCopyright © 2022. All rights reserved.