mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-10-01 00:06:11 -04:00
close main connection quicker
This commit is contained in:
parent
4ee1abdaff
commit
7682929c11
@ -168,6 +168,9 @@ func (m *Client) monitor() {
|
|||||||
case id := <-m.session2Remove:
|
case id := <-m.session2Remove:
|
||||||
m.access.Lock()
|
m.access.Lock()
|
||||||
delete(m.sessions, id)
|
delete(m.sessions, id)
|
||||||
|
if len(m.sessions) == 0 {
|
||||||
|
m.cancel()
|
||||||
|
}
|
||||||
m.access.Unlock()
|
m.access.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,6 +180,9 @@ func (m *Client) cleanup() {
|
|||||||
m.access.Lock()
|
m.access.Lock()
|
||||||
defer m.access.Unlock()
|
defer m.access.Unlock()
|
||||||
|
|
||||||
|
m.inboundRay.InboundInput().Close()
|
||||||
|
m.inboundRay.InboundOutput().CloseError()
|
||||||
|
|
||||||
for _, s := range m.sessions {
|
for _, s := range m.sessions {
|
||||||
s.closeUplink()
|
s.closeUplink()
|
||||||
s.closeDownlink()
|
s.closeDownlink()
|
||||||
|
Loading…
Reference in New Issue
Block a user