mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
prevent double close in tcp hub
This commit is contained in:
@@ -63,11 +63,16 @@ func ListenTCP(address v2net.Address, port v2net.Port, callback ConnectionHandle
|
||||
}
|
||||
|
||||
func (v *TCPHub) Close() {
|
||||
defer func() {
|
||||
recover()
|
||||
}()
|
||||
|
||||
select {
|
||||
case <-v.closed:
|
||||
return
|
||||
default:
|
||||
v.listener.Close()
|
||||
close(v.closed)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user