Jump to content

socket_read... forever!


aximbigfan

Recommended Posts

Hi,

 

I have a PHP socket server I wrote. in the server, socket_read() is obviously going to be used alot. The trouble is that socket_read wants to have a point at which it will stop reading. How can I have it just read until the stream ends? I have tried putting 0 in that argument, to no effect.

 

Thanks,

Chris

Link to comment
https://forums.phpfreaks.com/topic/119005-socket_read-forever/
Share on other sites

Take a look at socket_listen()

 

http://us.php.net/socket_listen

 

That might be what you're looking for.

 

If it's not, try looking at the alternatives for reading ends...

http://us.php.net/manual/en/function.socket-read.php

\r \n \0 depending on the read type.

Link to comment
https://forums.phpfreaks.com/topic/119005-socket_read-forever/#findComment-612791
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.