Interface ServerWebsocketSession


public interface ServerWebsocketSession
Minimal server-side WebSocket session contract used by the in-memory Fluxzero test server.
  • Field Details

    • DEFAULT_MAX_BINARY_FRAGMENT_BYTES

      static final int DEFAULT_MAX_BINARY_FRAGMENT_BYTES
      Default upper bound for one physical WebSocket binary frame when a message is sent as fragments.
      See Also:
  • Method Details

    • getRequestURI

      URI getRequestURI()
      Returns the URI that was used for the WebSocket upgrade request.
    • getRequestParameterMap

      Map<String, List<String>> getRequestParameterMap()
      Returns the decoded query parameters from the WebSocket upgrade request.
    • getRequestHeaders

      Map<String, List<String>> getRequestHeaders()
      Returns the headers from the WebSocket upgrade request.
    • getUserProperties

      Map<String,Object> getUserProperties()
      Returns per-session attributes derived during the WebSocket handshake.
    • isOpen

      boolean isOpen()
      Returns whether the underlying transport still accepts frames.
    • sendBinary

      void sendBinary(ByteBuffer data) throws IOException
      Sends a complete binary message.
      Throws:
      IOException
    • sendBinaryAsync

      default CompletableFuture<Void> sendBinaryAsync(ByteBuffer data)
      Sends a complete binary message asynchronously.

      The default delegates to the blocking send so existing lightweight sessions remain compatible.

    • sendBinaryAsync

      default CompletableFuture<Void> sendBinaryAsync(ByteBuffer data, int maxFragmentBytes)
      Sends one complete binary WebSocket message asynchronously, allowing implementations to split the message into WebSocket continuation frames.

      The default delegates to sendBinaryAsync(ByteBuffer) so existing simple implementations keep working. Implementations that support native WebSocket fragmentation should preserve message ordering and complete the returned future only after the final fragment has been accepted by the transport.

    • sendPing

      void sendPing(ByteBuffer applicationData) throws IOException
      Sends a ping frame with optional application data.
      Throws:
      IOException
    • close

      void close() throws IOException
      Closes the session normally.
      Throws:
      IOException
    • close

      void close(WebsocketCloseReason closeReason) throws IOException
      Closes the session with the provided WebSocket close code and reason.
      Throws:
      IOException
    • abort

      void abort(WebsocketCloseReason closeReason)
      Terminates the connection without waiting for a close handshake.