mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-16 10:06:05 +00:00
attempt to keep TCP listener alive if there's a temporary error (e.g. too many open files), just pause and retry later
This commit is contained in:
@ -226,7 +226,13 @@ func (t *tcp) listener(l *TcpListener, listenaddr string) {
|
||||
sock, err := l.Listener.Accept()
|
||||
if err != nil {
|
||||
t.links.core.log.Errorln("Failed to accept connection:", err)
|
||||
return
|
||||
select {
|
||||
case <-l.stop:
|
||||
return
|
||||
default:
|
||||
}
|
||||
time.Sleep(time.Second) // So we don't busy loop
|
||||
continue
|
||||
}
|
||||
t.waitgroup.Add(1)
|
||||
options := tcpOptions{
|
||||
|
Reference in New Issue
Block a user