Jump to content

socket read and write


alin19

Recommended Posts

i've started creating a program in php cli that conects to a server from where i read some datas and i must send back also soma data

 

i will try to make a schematic:

 

socket_conect.......

 

 

while (true)

{

$x=socket_read

 

echo $x;

 

$y=mysql_query("select * ........");

 

socket_write($y[0]);

}

 

something like this works my program, the problem is with this:

the program reads some data and then sends back, but if there is no data to read he waits until there is something to read and he doesnt send nothing in this waiting time

 

i can't find anything to rezolve this problem,

please help

Link to comment
https://forums.phpfreaks.com/topic/128813-socket-read-and-write/
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.