How can I go about sending data almost continuously to my server Protocol is udp. If I try to read some time (1) in the loop, then I do not get anything. It seems that reading will only resonate once all the readings happen. So it waits till the loop is never read, which it will never be. I want to socket_read immediately to echo when the data is found here is the code which does not work Thanks in advance.
& lt ;? Php $ sock = socket_create (AF_INET, SOCK_DGRAM, SOL_UDP); Socket_bind ($ sock, $ local, $ port) or die ('can not be compelled to address'); // This is where reading should be loop while (1) {echo socket_read ($ sock, 1024); } Socket_close ($ sock); ? & Gt;
Try calling after that resonance statement immediately.
Comments
Post a Comment