Interface Stream

All Known Subinterfaces:
IStream
All Known Implementing Classes:
HTTP2Stream

public interface Stream

A Stream represents a bidirectional exchange of data on top of a Session.

Differently from socket streams, where the input and output streams are permanently associated with the socket (and hence with the connection that the socket represents), there can be multiple HTTP/2 streams present concurrently for an HTTP/2 session.

A Stream maps to an HTTP request/response cycle, and after the request/response cycle is completed, the stream is closed and removed from the session.

Like Session, Stream is the active part and by calling its API applications can generate events on the stream; conversely, Stream.Listener is the passive part, and its callbacks are invoked when events happen on the stream.

See Also: