feat(watchdog): implement keepalive mechanism and enhance connection handling

This commit is contained in:
2026-05-09 17:29:02 +08:00
parent 21a4b03c57
commit 9c684241d1
5 changed files with 105 additions and 18 deletions
+8 -1
View File
@@ -12,8 +12,8 @@ import (
"super-frpc/frpLogger"
"super-frpc/global"
"super-frpc/postLog"
"super-frpc/sys"
"super-frpc/session"
"super-frpc/sys"
"super-frpc/utils"
"super-frpc/watchdog"
"syscall"
@@ -81,6 +81,13 @@ func main() {
} else {
postLog.Info(fmt.Sprintf("Connected to Watchdog at %s:%d", "127.0.0.1", global.CurrentConfig.Watchdog.Port))
global.Is.WatchdogConnected = true
go func() {
if err := watchdog.StartKeepAlive(); err != nil {
postLog.Error(fmt.Sprintf("Watchdog keepalive stopped: %v", err))
global.Is.WatchdogConnected = false
}
}()
}
}