public class WebSocketClose extends End
This is a control exception, a subtype of End
.
It's used by WebSocketChannel.readMessage()
.
Close-Frame
is sent by a WebSocket endpoint to
gracefully close its outbound direction,
see RFC6455 §5.5.1.
The Close-Frame may contain code and reason for diagnosis.
Constructor and Description |
---|
WebSocketClose(int code,
String reason)
Create a WebSocketClose instance.
|
Instance Methods | |
---|---|
int |
code()
The code given by the Close-Frame.
|
String |
reason()
The reason given by the Close-Frame.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public WebSocketClose(int code, String reason)
public int code()
See RFC6455 §7.4.
public String reason()