So I'm writing a chat with a php socket server.
CODE: http://pastebin.com/v5XKkfyyIf i try to debug by
print_r($read); just before line 75 i get this outputArray
(
[2] => Resource id #6
[0] => Resource id #4
)
PHP Warning: socket_select(): 6 is not a valid Socket resource in /var/www/chat/server.php on line 75
Warning: socket_select(): 6 is not a valid Socket resource in /var/www/chat/server.php on line 75
PHP Warning: socket_select(): 6 is not a valid Socket resource in /var/www/chat/server.php on line 75
Warning: socket_select(): 6 is not a valid Socket resource in /var/www/chat/server.php on line 75
Array
(
[0] => Resource id #4
)
This is happening just as i call line 424.
Someone on freenode #php said i mite be passing an integer instead of a so开发者_开发技巧cket resource. I find that hard to belive.
Hope one of you can help me.We found the answer on freenode.
To fix this i had to comment out line 427: socket_close($client[$i]['sock']);
Thanks everybody!
精彩评论