I am in the beginning stages of writing my first socket based php app from
scratch.  However I think I've quickly picked up a bad coding habbit when
reading from sockets.  I'm doing the following:

//writing the socket
socket_write ($socket,"blah blah$CRLF", strlen ($in));

//sleeping for 1 second...
sleep(1);

//after sleeping, i'll check to see if there is input...
$output = socket_read($socket,1024);

Can anyone give me a better example of how I should be doing this?  I could
get events sent back at any time.  I tried the example on the php.net's
documentation (binding and accepting) but it failed to work for me on the
latest php (4.3.0pre2).  It just kept timing out for me.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to