alin19 Posted September 16, 2008 Share Posted September 16, 2008 i have this part of my code that reads from the server, if there is something output by the server and then write, the problem is that if there is nothing to read he waits until something is there, and only after that he try to write. how can i do that he tryes to read and write in the same time,? while (true) { if (false === ($line = socket_read($sock,10000))) echo "socket_read() failed: reason: " . socket_strerror(socket_last_error($msgsock)) . "\n"; else { echo $line; } if (socket_write($sock, $order)) echo "sa facut trimiterea de ordin"; else { echo "a aparut eroare la trimitere ordin"; } } Link to comment https://forums.phpfreaks.com/topic/124443-socket-read-and-write-in-the-same-time/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.