Question about socket_read()
Posted: Thu Oct 23, 2003 5:14 pm
Hello,
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:
PHP will pause the script until something is received when you do socket_read(); I want to be able to do something while the socket is not receiving anything and have it check to see if it is receiving something at the same time.
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?
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?