interface ServerWebSocket : WebSocketBase
Represents a server side WebSocket.
Instances of this class are passed into a io.vertx.core.http.HttpServer#websocketHandler or provided when a WebSocket handshake is manually HttpServerRequest#upgradeed.
Author
Tim Fox
abstract fun accept(): Unit
Accept the WebSocket and terminate the WebSocket handshake. This method should be called from the websocket handler to explicitely accept the websocker and terminate the WebSocket handshake. |
|
abstract fun closeHandler(handler: Handler<Void>): ServerWebSocket |
|
abstract fun drainHandler(handler: Handler<Void>): ServerWebSocket |
|
abstract fun endHandler(endHandler: Handler<Void>): ServerWebSocket |
|
abstract fun exceptionHandler(handler: Handler<Throwable>): ServerWebSocket |
|
abstract fun frameHandler(handler: Handler<WebSocketFrame>): ServerWebSocket |
|
abstract fun handler(handler: Handler<Buffer>): ServerWebSocket |
|
abstract fun headers(): MultiMap |
|
abstract fun path(): String |
|
abstract fun pause(): ServerWebSocket |
|
abstract fun peerCertificateChain(): Array<X509Certificate>
Note: Java SE 5+ recommends to use javax.net.ssl.SSLSession#getPeerCertificates() instead of of javax.net.ssl.SSLSession#getPeerCertificateChain() which this method is based on. Use |
|
abstract fun query(): String |
|
abstract fun reject(): Unit
Reject the WebSocket. Calling this method from the websocket handler when it is first passed to you gives you the opportunity to reject the websocket, which will cause the websocket handshake to fail by returning a 502 response code. You might use this method, if for example you only want to accept WebSockets with a particular path. abstract fun reject(status: Int): Unit
Like |
|
abstract fun resume(): ServerWebSocket |
|
abstract fun setWriteQueueMaxSize(maxSize: Int): ServerWebSocket |
|
abstract fun sslSession(): SSLSession |
|
abstract fun uri(): String |
|
abstract fun write(data: Buffer): ServerWebSocket |
|
abstract fun writeBinaryMessage(data: Buffer): ServerWebSocket |
|
abstract fun writeFinalBinaryFrame(data: Buffer): ServerWebSocket |
|
abstract fun writeFinalTextFrame(text: String): ServerWebSocket |
|
abstract fun writeFrame(frame: WebSocketFrame): ServerWebSocket |