Interface Session
- All Known Implementing Classes:
 AbstractSession, QuicheSession
Represents a QUIC connection to a remote peer.
A Session represents 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.
- 
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceASession.Listeneris the passive counterpart of aSessionand receives events happening on an QUIC connection. - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose(ConnectionCloseFrame frame, Promise.Invocable<Session> promise) Closes this session with the givenCONNECTION_CLOSEframe.voiddisconnect(ConnectionCloseFrame frame, Throwable failure, Promise.Invocable<Session> promise) Disconnects this session, with the givenCONNECTION_CLOSEand failure cause, if any.getId()longlonggetStream(long streamId) voidmaxData(MaxDataFrame frame, Promise.Invocable<Session> promise) Sends a MAX_DATA frame on this connection.voidmaxStreams(MaxStreamsFrame frame, Promise.Invocable<Session> promise) Sends a MAX_STREAMS frame on this connection.newStream(long streamId, Stream.Listener listener) Creates a new local QUIC stream with the given stream id and listener.longnewStreamId(boolean bidirectional) Creates a new QUIC stream id, with the given directionality.voidping(Promise.Invocable<Session> promise) Sends a PING frame on this connection. 
- 
Method Details
- 
getId
String getId()- Returns:
 - the QUIC connection id
 
 - 
newStreamId
long newStreamId(boolean bidirectional) Creates a new QUIC stream id, with the given directionality.
- Parameters:
 bidirectional- whether the stream is bidirectional or unidirectional- Returns:
 - a new QUIC stream id
 
 - 
newStream
Creates a new local QUIC stream with the given stream id and listener.
- Parameters:
 streamId- the QUIC stream idlistener- the listener of stream events- Returns:
 - a new local QUIC stream
 
 - 
getStream
- Parameters:
 streamId- the stream id- Returns:
 - the QUIC stream with the given stream id
 
 - 
maxStreams
Sends a MAX_STREAMS frame on this connection.
- Parameters:
 frame- the frame to sendpromise- thePromise.Invocablethat gets notified when the frame has been sent
 - 
ping
Sends a PING frame on this connection.
- Parameters:
 promise- thePromise.Invocablethat gets notified when the frame has been sent
 - 
maxData
Sends a MAX_DATA frame on this connection.
- Parameters:
 frame- the frame to sendpromise- thePromise.Invocablethat gets notified when the frame has been sent
 - 
close
Closes this session with the given
CONNECTION_CLOSEframe.Applications should use this method in conjunction with
ConnectionCloseFrame(long, String).Differently from
disconnect(ConnectionCloseFrame, Throwable, Promise.Invocable), this method performs close actions inwards, towards the application, that may perform additional actions such as writing to the network, for example close frames for a protocol on top of QUIC.After finishing the inward actions,
disconnect(ConnectionCloseFrame, Throwable, Promise.Invocable)should be called to perform close actions outwards and eventually send the QUIC close frame and finally disconnect at the network level, if necessary.- Parameters:
 frame- the frame carrying the error code and reasonpromise- theCallbackthat gets notified when the close is complete
 - 
disconnect
Disconnects this session, with the given
CONNECTION_CLOSEand failure cause, if any.Differently from
close(ConnectionCloseFrame, Promise.Invocable), this method performs disconnect actions outwards, towards the network: typically clean-up actions and eventually sends the given QUIC close frame and finally disconnect at the network level, if necessary.- Parameters:
 frame- the frame carrying the error code and reasonfailure- the failure that caused the disconnect, ornullpromise- thePromise.Invocablethat gets notified when the disconnect is complete
 - 
getStreams
Collection<Stream> getStreams()- Returns:
 - the QUIC streams managed by this session
 
 - 
getLocalSocketAddress
SocketAddress getLocalSocketAddress()- Returns:
 - the local 
SocketAddressassociated with this session 
 - 
getRemoteSocketAddress
SocketAddress getRemoteSocketAddress()- Returns:
 - the remote 
SocketAddressassociated with this session 
 - 
getLocalBidirectionalMaxStreams
long getLocalBidirectionalMaxStreams()- Returns:
 - the local bidirectional streams max count
 
 - 
getIdleTimeout
long getIdleTimeout()- Returns:
 - the idle timeout in milliseconds
 
 
 -