|
@@ -36,9 +36,9 @@ $gateway->startPort = 2900;
|
|
|
$gateway->registerAddress = '127.0.0.1:1238';
|
|
$gateway->registerAddress = '127.0.0.1:1238';
|
|
|
|
|
|
|
|
// 心跳间隔
|
|
// 心跳间隔
|
|
|
-$gateway->pingInterval = 10;
|
|
|
|
|
|
|
+//$gateway->pingInterval = 10;
|
|
|
// 心跳数据
|
|
// 心跳数据
|
|
|
-$gateway->pingData = '{"message_type":"ping"}';
|
|
|
|
|
|
|
+//$gateway->pingData = '{"message_type":"ping"}';
|
|
|
|
|
|
|
|
|
|
|
|
|
// 当客户端连接上来时,设置连接的onWebSocketConnect,即在websocket握手时的回调
|
|
// 当客户端连接上来时,设置连接的onWebSocketConnect,即在websocket握手时的回调
|
|
@@ -52,7 +52,7 @@ $gateway->onConnect = function ($connection) {
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($getToken !== $apiToken) {
|
|
if ($getToken !== $apiToken) {
|
|
|
- //$connection->close();
|
|
|
|
|
|
|
+ //$connection->close();
|
|
|
// return;
|
|
// return;
|
|
|
}
|
|
}
|
|
|
$_SESSION['remotip'] = $connection->getRemoteIp();
|
|
$_SESSION['remotip'] = $connection->getRemoteIp();
|