I was wondering how can I set a timeout on a socket_read call? The first time it calls socket_read, it waits till data is sent, and if no data is s
socket_read
this set 5 sec timeout of the socket.
socket_set_option($socket,SOL_SOCKET, SO_RCVTIMEO, array("sec"=>5, "usec"=>0));