forked from quic-go/quic-go
@@ -565,10 +565,16 @@ func (s *Session) logPacket(packet *packedPacket) {
|
||||
}
|
||||
|
||||
// GetOrOpenStream either returns an existing stream, a newly opened stream, or nil if a stream with the provided ID is already closed.
|
||||
// Newly opened streams should only originate from the client. To open a stream from the server, OpenStream should be used.
|
||||
func (s *Session) GetOrOpenStream(id protocol.StreamID) (utils.Stream, error) {
|
||||
return s.streamsMap.GetOrOpenStream(id)
|
||||
}
|
||||
|
||||
// OpenStream opens a stream from the server's side
|
||||
func (s *Session) OpenStream(id protocol.StreamID) (utils.Stream, error) {
|
||||
return s.streamsMap.OpenStream(id)
|
||||
}
|
||||
|
||||
func (s *Session) newStreamImpl(id protocol.StreamID) (*stream, error) {
|
||||
return s.streamsMap.GetOrOpenStream(id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user