mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-18 08:46:06 +00:00
use TLS for multicast peers, fix TLS listener type in log output
This commit is contained in:
@ -185,17 +185,21 @@ func (t *tcp) listener(l *TcpListener, listenaddr string) {
|
||||
l.Listener.Close()
|
||||
return
|
||||
}
|
||||
callproto := "TCP"
|
||||
if l.opts.upgrade != nil {
|
||||
callproto = strings.ToUpper(l.opts.upgrade.name)
|
||||
}
|
||||
t.listeners[listenaddr] = l
|
||||
t.mutex.Unlock()
|
||||
// And here we go!
|
||||
defer func() {
|
||||
t.links.core.log.Infoln("Stopping TCP listener on:", l.Listener.Addr().String())
|
||||
t.links.core.log.Infoln("Stopping", callproto, "listener on:", l.Listener.Addr().String())
|
||||
l.Listener.Close()
|
||||
t.mutex.Lock()
|
||||
delete(t.listeners, listenaddr)
|
||||
t.mutex.Unlock()
|
||||
}()
|
||||
t.links.core.log.Infoln("Listening for TCP on:", l.Listener.Addr().String())
|
||||
t.links.core.log.Infoln("Listening for", callproto, "on:", l.Listener.Addr().String())
|
||||
go func() {
|
||||
<-l.stop
|
||||
l.Listener.Close()
|
||||
|
Reference in New Issue
Block a user