Browse Source

减少输出

lizhen_gitee 1 year ago
parent
commit
14be754614
2 changed files with 4 additions and 4 deletions
  1. 2 2
      application/chat/Events.php
  2. 2 2
      application/chat/start_gateway.php

+ 2 - 2
application/chat/Events.php

@@ -45,8 +45,8 @@ class Events
      */
     public static function onMessage($client_id, $message)
     {
-         echo $message.PHP_EOL;
-         file_put_contents('1.json',$message.PHP_EOL,FILE_APPEND);
+         //echo $message.PHP_EOL;
+         //file_put_contents('1.json',$message.PHP_EOL,FILE_APPEND);
          $info = Db::name('gateway_test')->insertGetId(['msg'=>'[msg]'.$message,'datetime'=>date('Y-m-d H:i:s')]);
          return;
 

+ 2 - 2
application/chat/start_gateway.php

@@ -18,7 +18,7 @@ use \Workerman\Autoloader;
 //require_once __DIR__ . '/../../vendor/autoload.php';
 
 // gateway 进程
-$gateway = new Gateway("websocket://0.0.0.0:2349");
+$gateway = new Gateway("websocket://0.0.0.0:2346");
 // 设置名称,方便status时查看
 $gateway->name = 'ChatGateway';
 // 设置进程数,gateway进程数建议与cpu核数相同
@@ -27,7 +27,7 @@ $gateway->count = 4;
 $gateway->lanIp = '127.0.0.1';
 // 内部通讯起始端口。假如$gateway->count=4,起始端口为2300
 // 则一般会使用2300 2301 2302 2303 4个端口作为内部通讯端口 
-$gateway->startPort = 2350;
+$gateway->startPort = 2347;
 // 心跳间隔
 $gateway->pingInterval = 10;
 // 心跳数据