public class WebSocketResponse extends Object
A handshake response is either a WebSocketResponse.Reject
or an WebSocketResponse.Accept
.
See WebSocketHandler
.
Modifier and Type | Class and Description |
---|---|
static class |
WebSocketResponse.Reject
To reject the handshake.
|
static class |
WebSocketResponse.Accept
To accept the handshake.
|
Static Methods | |
---|---|
WebSocketResponse.Reject |
reject(int statusCode,
String msg)
Create a Reject response.
|
WebSocketResponse.Accept |
accept(FunctionX<WebSocketChannel,Async<?>> channelHandler)
Create an Accept response.
|
public static WebSocketResponse.Reject reject(int statusCode, String msg)
This method is equivalent to
new WebSocketResponse.Reject( HttpResponse.text(statusCode, msg) )
public static WebSocketResponse.Accept accept(FunctionX<WebSocketChannel,Async<?>> channelHandler)
This method is equivalent to
new WebSocketResponse.Accept(null, channelHandler);