Interface WebsocketSession


public interface WebsocketSession
Minimal websocket session contract needed by the Fluxzero runtime clients.

The contract is binary-frame oriented because Fluxzero runtime traffic is serialized and compressed before it is sent. Implementations should make close and abort callbacks idempotent so higher-level retry logic can safely react to transport races.

  • Method Details

    • getRequestURI

      URI getRequestURI()
      Returns the URI used to open this session.
    • getUserProperties

      Map<String,Object> getUserProperties()
      Returns mutable metadata associated with this session.

      Fluxzero clients use these properties to store negotiated session identifiers, runtime version information, and selected compression settings.

    • getHandshakeResponseHeaders

      Map<String, List<String>> getHandshakeResponseHeaders()
      Returns the response headers from the successful opening handshake.
    • getOpenSessions

      Set<WebsocketSession> getOpenSessions()
      Returns a snapshot of currently open sessions owned by the same connector.
    • isOpen

      boolean isOpen()
      Returns whether the session is still open for application traffic.
    • sendBinary

      void sendBinary(ByteBuffer data) throws IOException
      Sends one complete binary WebSocket message.
      Parameters:
      data - bytes from the buffer's current position to its limit
      Throws:
      IOException - when the frame cannot be sent
    • sendPing

      void sendPing(ByteBuffer applicationData) throws IOException
      Sends a ping frame.
      Parameters:
      applicationData - ping payload from the buffer's current position to its limit
      Throws:
      IOException - when the frame cannot be sent
    • close

      void close() throws IOException
      Closes the session with a normal close reason.
      Throws:
      IOException - when the close frame cannot be sent
    • close

      void close(WebsocketCloseReason closeReason) throws IOException
      Closes the session with a specific close reason.
      Parameters:
      closeReason - close status and reason to send
      Throws:
      IOException - when the close frame cannot be sent
    • abort

      void abort(WebsocketCloseReason closeReason)
      Immediately aborts the underlying transport and reports the given close reason to the endpoint.
      Parameters:
      closeReason - synthetic close status and reason to report