瀏覽代碼

simpleChat remove get_client_list

walkor 10 年之前
父節點
當前提交
458cfea62f
共有 1 個文件被更改,包括 0 次插入17 次删除
  1. 0 17
      Applications/SimpleChat/start_websocket_server.php

+ 0 - 17
Applications/SimpleChat/start_websocket_server.php

@@ -24,7 +24,6 @@ $ws_server->onConnect = function($connection)
                 'time' => date('Y-m-d H:i:s'),
                 // @see http://doc3.workerman.net/worker-development/id.html
                 'from_id' => $connection->id,
-                'client_list' => get_client_list(),
         );
         broad_cast(json_encode($data));
     };
@@ -51,7 +50,6 @@ $ws_server->onClose = function($connection)
                 'time' => date('Y-m-d H:i:s'),
                 // @see http://doc3.workerman.net/worker-development/id.html
                 'from_id' => $connection->id,
-                'client_list' => get_client_list(),
         );
         broad_cast(json_encode($data));
 };
@@ -72,21 +70,6 @@ function broad_cast($msg)
     }
 }
 
-/**
- * get all client
- * @return array
- */
-function get_client_list()
-{
-    global $ws_server;
-    $client_list = array();
-    foreach($ws_server->connections as $connection)
-    {
-        $client_list[] = $connection->id;
-    }
-    return $client_list;
-}
-
 
 // 如果不是在根目录启动,则运行runAll方法
 if(!defined('GLOBAL_START'))