Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 3872e44

Browse files
committed
✨ 添加掉线退出的逻辑
1 parent 44be1fe commit 3872e44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

inc/socketio.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public function connect() {
7575
$this->keepalive($kacounters);
7676
});
7777
}
78+
elseif (isset($jsondata[0][1]) && $jsondata[0][1] == "0"){
79+
mlog("[socket.io]主控返回节点已掉线");
80+
global $pid;
81+
posix_kill($pid, SIGINT);
82+
}
7883
elseif (isset($jsondata[0][1]) && $this->IsTime($jsondata[0][1])){
7984
global $kadata;
8085
mlog(" Keep-alive success: hits={$kadata['hits']} bytes={$kadata['bytes']} Time={$jsondata[0][1]}");

0 commit comments

Comments
 (0)