improve gatway and p2papp reconnect

This commit is contained in:
TenderIronh
2022-11-25 23:55:33 +08:00
parent c8b8bf05a5
commit c3a43be3cc
4 changed files with 22 additions and 16 deletions
+4 -1
View File
@@ -204,12 +204,15 @@ func (app *p2pApp) listen() error {
if app.rtid != 0 {
go app.relayHeartbeatLoop()
}
for app.tunnel.isRuning() && app.running {
for app.tunnel.isRuning() {
if app.config.Protocol == "udp" {
app.listenUDP()
} else {
app.listenTCP()
}
if !app.running {
break
}
time.Sleep(time.Second * 10)
}
return nil