replace Session.WaitUntilClosed() by a context

This commit is contained in:
Marten Seemann
2017-07-26 16:44:17 +07:00
parent 811315e31a
commit e02f5d5fbe
5 changed files with 41 additions and 43 deletions

View File

@@ -1,6 +1,7 @@
package quic
import (
"context"
"io"
"net"
"time"
@@ -56,9 +57,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.