Package akka.http.javadsl.model.ws
Class WebSocketCloseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- akka.http.javadsl.model.ws.WebSocketCloseException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
WebSocketCloseException
public abstract class WebSocketCloseException extends java.lang.RuntimeExceptionFail the outgoing message stream of a WebSocket handler with aWebSocketCloseExceptionto close the WebSocket with an application specific close code (3000-4999) and reason. The peer will see the close code and reason (in Akka HTTP as aPeerClosedConnectionException).Note that failing a stream may discard messages buffered in stages downstream of the failing stage. An ongoing streamed message is given the close timeout (3 seconds) to finish before the WebSocket is closed.
Create instances using
create.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebSocketCloseException(int closeCode, java.lang.String closeReason)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcloseCode()java.lang.StringcloseReason()static WebSocketCloseExceptioncreate(int closeCode)Create an exception closing the WebSocket with the given close code and an empty reason.static WebSocketCloseExceptioncreate(int closeCode, java.lang.String closeReason)Create an exception closing the WebSocket with the given close code and reason.
-
-
-
Method Detail
-
create
public static WebSocketCloseException create(int closeCode, java.lang.String closeReason)
Create an exception closing the WebSocket with the given close code and reason.- Parameters:
closeCode- an application specific close code in the range 3000-4999closeReason- a reason, at most 123 bytes when UTF-8 encoded- Returns:
- (undocumented)
-
create
public static WebSocketCloseException create(int closeCode)
Create an exception closing the WebSocket with the given close code and an empty reason.- Parameters:
closeCode- an application specific close code in the range 3000-4999- Returns:
- (undocumented)
-
closeCode
public int closeCode()
-
closeReason
public java.lang.String closeReason()
-
-