forked from quic-go/quic-go
implement an AcceptStream method in the Session
This commit is contained in:
@@ -490,6 +490,7 @@ func (s *Session) closeImpl(e error, remoteClose bool) error {
|
||||
}
|
||||
|
||||
if e == errCloseSessionForNewVersion {
|
||||
s.streamsMap.CloseWithError(e)
|
||||
s.closeStreamsWithError(e)
|
||||
// when the run loop exits, it will call the closeCallback
|
||||
// replace it with an noop function to make sure this doesn't have any effect
|
||||
@@ -511,6 +512,7 @@ func (s *Session) closeImpl(e error, remoteClose bool) error {
|
||||
utils.Errorf("Closing session with error: %s", e.Error())
|
||||
}
|
||||
|
||||
s.streamsMap.CloseWithError(quicErr)
|
||||
s.closeStreamsWithError(quicErr)
|
||||
|
||||
if remoteClose {
|
||||
@@ -666,6 +668,11 @@ func (s *Session) GetOrOpenStream(id protocol.StreamID) (utils.Stream, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// AcceptStream returns the next stream openend by the peer
|
||||
func (s *Session) AcceptStream() (utils.Stream, error) {
|
||||
return s.streamsMap.AcceptStream()
|
||||
}
|
||||
|
||||
// OpenStream opens a stream
|
||||
func (s *Session) OpenStream() (utils.Stream, error) {
|
||||
return s.streamsMap.OpenStream()
|
||||
|
||||
Reference in New Issue
Block a user