Class WebSocketCloseException

  • All Implemented Interfaces:
    java.io.Serializable

    public final class WebSocketCloseException
    extends WebSocketCloseException
    Fail the outgoing message stream of a WebSocket handler with a WebSocketCloseException to 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 a PeerClosedConnectionException).

    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.

    param: closeCode an application specific close code in the range 3000-4999 param: closeReason a reason, at most 123 bytes when UTF-8 encoded

    See Also:
    Serialized Form
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WebSocketCloseException

        public WebSocketCloseException​(int closeCode,
                                       java.lang.String closeReason)
      • WebSocketCloseException

        public WebSocketCloseException​(int closeCode)