mirror of
https://github.com/xtaci/smux.git
synced 2024-04-21 10:51:48 +00:00
NumStream should return 0 when Closed
This commit is contained in:
@@ -125,6 +125,9 @@ func (s *Session) IsClosed() bool {
|
||||
|
||||
// NumStreams returns the number of currently open streams
|
||||
func (s *Session) NumStreams() int {
|
||||
if s.IsClosed() {
|
||||
return 0
|
||||
}
|
||||
s.streamLock.Lock()
|
||||
defer s.streamLock.Unlock()
|
||||
return len(s.streams)
|
||||
|
||||
Reference in New Issue
Block a user