close main connection quicker

pull/432/head v2.21.3
Darien Raymond 8 years ago
parent 4ee1abdaff
commit 7682929c11
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -168,6 +168,9 @@ func (m *Client) monitor() {
case id := <-m.session2Remove:
m.access.Lock()
delete(m.sessions, id)
if len(m.sessions) == 0 {
m.cancel()
}
m.access.Unlock()
}
}
@ -177,6 +180,9 @@ func (m *Client) cleanup() {
m.access.Lock()
defer m.access.Unlock()
m.inboundRay.InboundInput().Close()
m.inboundRay.InboundOutput().CloseError()
for _, s := range m.sessions {
s.closeUplink()
s.closeDownlink()

Loading…
Cancel
Save