websockets socket_select错误

时间:2012-07-23 08:41:37

标签: php websocket phpwebsocket

您好我试图在客户端和服务器之间实现websocket通信。问题是当我试图在命令行中启动服务器时出现此错误

# php -q htdocs\socket\server\startDaemon.php
2012-07-23 10:10:02 System: Socket Resource id #7 cre
2012-07-23 10:10:02 System: Socket bound to localhost
2012-07-23 10:10:02 System: Start listening on Socket

Strict Standards: Only variables should be passed by reference in 
C:\xampp\htdocs\socket\server\socketWebSocket.class.php on line 35

第35行的代码如上:

$num_sockets = socket_select($changed_sockets,$write=NULL,$exceptions=NULL,NULL);

我已经搜索了答案,但没有任何效果。有谁能够帮我?感谢名单

1 个答案:

答案 0 :(得分:8)

尝试

$write=NULL;
$exceptions=NULL;

$num_sockets = socket_select($changed_sockets,$write,$exceptions, NULL);