diff --git a/transport/internet/tcp_hub.go b/transport/internet/tcp_hub.go index 775b494a..786e8bd2 100644 --- a/transport/internet/tcp_hub.go +++ b/transport/internet/tcp_hub.go @@ -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) } }