// The context is canceled as soon as the write-side of the stream is closed.
// This happens when Close() is called, or when the stream is reset (either locally or remotely).
// Warning: This API should not be considered stable and might change soon.
Context()context.Context
// SetReadDeadline sets the deadline for future Read calls and
// any currently-blocked Read call.
// A zero value for t means Read will not time out.
...
...
@@ -43,7 +48,7 @@ type Session interface {
// AcceptStream returns the next stream opened by the peer, blocking until one is available.
// Since stream 1 is reserved for the crypto stream, the first stream is either 2 (for a client) or 3 (for a server).
AcceptStream()(Stream,error)
// OpenStream opens a new QUIC stream, returning a special error when the peeer's concurrent stream limit is reached.
// OpenStream opens a new QUIC stream, returning a special error when the peer's concurrent stream limit is reached.
// New streams always have the smallest possible stream ID.
// TODO: Enable testing for the special error
OpenStream()(Stream,error)
...
...
@@ -56,9 +61,9 @@ type Session interface {
RemoteAddr()net.Addr
// Close closes the connection. The error will be sent to the remote peer in a CONNECTION_CLOSE frame. An error value of nil is allowed and will cause a normal PeerGoingAway to be sent.
Close(error)error
// WaitUntilClosed() blocks until the session is closed.
// The context is cancelled when the session is closed.
// Warning: This API should not be considered stable and might change soon.
WaitUntilClosed()
Context()context.Context
}
// A NonFWSession is a QUIC connection between two peers half-way through the handshake.