diff --git a/common/mux/session.go b/common/mux/session.go index 5e4b69ca..1530a661 100644 --- a/common/mux/session.go +++ b/common/mux/session.go @@ -50,11 +50,11 @@ func (m *SessionManager) Count() int { return int(m.count) } -func (m *SessionManager) Allocate() *Session { +func (m *SessionManager) Allocate(MaxConcurrency int) *Session { m.Lock() defer m.Unlock() - if m.closed { + if m.closed || (MaxConcurrency > 0 && len(m.sessions) >= MaxConcurrency) { return nil }