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()
EngineIoWebSocket
getQuery
in class EngineIoWebSocket
public Map<String,List<String>> getConnectionHeaders()
EngineIoWebSocket
getConnectionHeaders
in class EngineIoWebSocket
public void write(String message) throws IOException
EngineIoWebSocket
write
in class EngineIoWebSocket
message
- String payload to send.IOException
- On write error.public void write(byte[] message) throws IOException
EngineIoWebSocket
write
in class EngineIoWebSocket
message
- Binary payload to send.IOException
- On write error.public void close()
EngineIoWebSocket
close
in class EngineIoWebSocket
public void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)
onWebSocketConnect
in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
public void onWebSocketClose(int statusCode, String reason)
onWebSocketClose
in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
public void onWebSocketError(Throwable cause)
onWebSocketError
in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
public void onWebSocketBinary(byte[] payload, int offset, int len)
onWebSocketBinary
in interface org.eclipse.jetty.websocket.api.WebSocketListener
public void onWebSocketText(String message)
onWebSocketText
in interface org.eclipse.jetty.websocket.api.WebSocketListener
Copyright © 2022. All rights reserved.