新增:连接健康检查

git-svn-id: svn://47.119.165.148/zhub@123 e63fbceb-bcc3-4977-ac22-735b83d8d0f4
This commit is contained in:
lxy
2021-08-05 08:07:06 +00:00
parent ddbab4b725
commit 05e5e41314
3 changed files with 81 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import (
"log"
"strconv"
"strings"
"time"
"zhub/conf"
)
@@ -22,6 +23,12 @@ func msgAccept(v Message) {
return
}
// ping reply
if strings.EqualFold("+pong", v.Rcmd[0]) {
v.Conn.pong = time.Now().Unix()
return
}
if conf.LogDebug {
log.Println("rcmd: " + strings.Join(rcmd, " "))
}