Interface Session

All Known Subinterfaces:
Session.Client, Session.Server

public interface Session

The low-level HTTP/3 API representing a connection with a remote peer.

A Session is the active part of the connection, and by calling its APIs applications can generate events on the connection.

Conversely, Session.Listener is the passive part of the connection, and has callback methods that are invoked when events happen on the connection.

See Also:
  • Method Details

    • getLocalSocketAddress

      default SocketAddress getLocalSocketAddress()
      Returns:
      the local socket address this session is bound to
    • getRemoteSocketAddress

      default SocketAddress getRemoteSocketAddress()
      Returns:
      the remote socket address this session is connected to
    • getStreams

      default Collection<Stream> getStreams()
      Returns:
      a snapshot of all the streams currently belonging to this session
    • goAway

      default CompletableFuture<Void> goAway(boolean graceful)

      Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.

      Parameters:
      graceful - whether the shutdown should be graceful
      Returns:
      the CompletableFuture that gets notified when the frame has been sent