Class OpeningHandshakeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.neovisionaries.ws.client.WebSocketException
com.neovisionaries.ws.client.OpeningHandshakeException
- All Implemented Interfaces:
Serializable
An exception raised due to a violation against the WebSocket protocol.
- Since:
- 1.19
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]private final StatusLineprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionOpeningHandshakeException(WebSocketError error, String message, StatusLine statusLine, Map<String, List<String>> headers) OpeningHandshakeException(WebSocketError error, String message, StatusLine statusLine, Map<String, List<String>> headers, byte[] body) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBody()Get the response body contained in the WebSocket opening handshake response from the server.Get the HTTP headers contained in the WebSocket opening handshake response from the server.Get the status line contained in the WebSocket opening handshake response from the server.Methods inherited from class WebSocketException
getErrorMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
mStatusLine
-
mHeaders
-
mBody
private final byte[] mBody
-
-
Constructor Details
-
OpeningHandshakeException
OpeningHandshakeException(WebSocketError error, String message, StatusLine statusLine, Map<String, List<String>> headers) -
OpeningHandshakeException
OpeningHandshakeException(WebSocketError error, String message, StatusLine statusLine, Map<String, List<String>> headers, byte[] body)
-
-
Method Details
-
getStatusLine
Get the status line contained in the WebSocket opening handshake response from the server.- Returns:
- The status line.
-
getHeaders
-
getBody
public byte[] getBody()Get the response body contained in the WebSocket opening handshake response from the server.This method returns a non-null value only when (1) the status code is not 101 (Switching Protocols), (2) the response from the server has a response body, (3) the response has "Content-Length" header, and (4) no error occurred during reading the response body. In other cases, this method returns
null.- Returns:
- The response body.
-