I am programming a script that uses a client socket to connect to a server. The only problem with the script for now is the socket_read().
When you do for instance:
Code: Select all
$buffer = "";
while(true){
$buffer .= socket_read($socket,255);
if ($buffer !== false) { parse_buffer($buffer) };
}Is there any way I can do something while socket_read() is waiting for data to be received? Or is there any way of knowing when I have data waiting to be read?