views:

38

answers:

1

So I'm writing a chat with a php socket server.
CODE:
http://pastebin.com/v5XKkfyy

If i try to debug by
print_r($read);
just before line 75 i get this output

Array
(
    [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 socket resource. I find that hard to belive.
Hope one of you can help me.

A: 

We found the answer on freenode.

To fix this i had to comment out line 427: socket_close($client[$i]['sock']);

Thanks everybody!

Putr