Skip to content

Commit

Permalink
心跳
Browse files Browse the repository at this point in the history
  • Loading branch information
fucongcong committed Jul 25, 2017
1 parent 90c0c4e commit 2143d62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Admin/Process/HeartbeatProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Group\Sync\Dao\Dao;
use Group\Sync\SyncApp;
use Group\Async\Client\Tcp;
use Group\Protocol\Protocol;

class HeartbeatProcess extends Process
{
Expand All @@ -25,7 +26,7 @@ public function register()
foreach ($res as $serv) {
$client = new Tcp($serv['ip'], $serv['port']);
$client->setTimeout(5);
$client->setData("p\r\n");
$client->setData(Protocol::pack('', 'p'));
$client->call(function($response, $error, $calltime) use ($serv, $dao) {
//服务挂了,或者异常了
if (!$response) {
Expand Down

0 comments on commit 2143d62

Please sign in to comment.