public abstract class ServerWebSocket extends WebSocket
HttpServer
Instances of this class are not thread-safe
Modifier and Type | Field and Description |
---|---|
java.lang.String |
path
The path the websocket is attempting to connect at
|
binaryHandlerID, textHandlerID
Modifier | Constructor and Description |
---|---|
protected |
ServerWebSocket(java.lang.String path,
java.lang.String binaryHandlerID,
java.lang.String textHandlerID) |
Modifier and Type | Method and Description |
---|---|
abstract void |
reject()
Reject the WebSocket
|
close, closedHandler, writeBinaryFrame, writeTextFrame
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dataHandler, endHandler, exceptionHandler, pause, resume
drainHandler, exceptionHandler, setWriteQueueMaxSize, writeBuffer, writeQueueFull
public final java.lang.String path
protected ServerWebSocket(java.lang.String path, java.lang.String binaryHandlerID, java.lang.String textHandlerID)
public abstract void reject()
Calling this method from the websocketHandler gives you the opportunity to reject the websocket, which will cause the websocket handshake to fail by returning a 404 response code.
You might use this method, if for example you only want to accept websockets with a particular path.