This commit is contained in:
2021-03-23 10:51:44 +08:00
parent d5c83bb633
commit 362d8ba2dc
2 changed files with 11 additions and 14 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ class Server extends HttpService
return null;
}
}
return $this->baseServer;
return $this->startRpcService();
}
@@ -353,7 +353,7 @@ class Server extends HttpService
}
$this->onListenerBind($config, $this->baseServer);
return $this->startRpcService();
return $this->baseServer;
}
+9 -12
View File
@@ -32,18 +32,15 @@ class Service extends Component
}
foreach ($services as $service) {
$mode = $service['mode'] ?? SWOOLE_SOCK_TCP6;
var_dump($service,$mode);
//
// $rpcServer = $server->addlistener($service['host'], $service['port'], $mode);
// $rpcServer->set([
// 'open_tcp_keepalive' => true,
// 'tcp_keepidle' => 30,
// 'tcp_keepinterval' => 10,
// 'tcp_keepcount' => 10,
// 'open_http_protocol' => false,
// 'open_websocket_protocol' => false,
// ]);
$rpcServer = $server->addlistener($service['host'], $service['port'], $mode);
$rpcServer->set([
'open_tcp_keepalive' => true,
'tcp_keepidle' => 30,
'tcp_keepinterval' => 10,
'tcp_keepcount' => 10,
'open_http_protocol' => false,
'open_websocket_protocol' => false,
]);
}
}