Hi there
I came accross a tutorial on how to use php.exe bins via command like and create a socket server using php.
See http://www.devshed.com/Server_Side/PHP/SocketProgramming/print_html
Unfortunately, this will only accept one client at a time.
Is there anyway that I can re-write the code to accept more than one connection in one script? ?same or different port?
What I need to do is to have the server accept two clients:
Socket 1= a continuous stream of DATA from client 1
Socket 2= created on demand and sends either START or STOP and then closes
The idea is that socket 2 acts as a "switch" for manipulating data from socket 1 which is always sending data. Hence when "START" is received from socket 2, it opens a file and dumps all of socket 1 data into that file from that point in time until a "STOP" is received from socket 2. As soon as this happens, the file is closed and data from socket 1 client is ignored until another "start" command is received from socket 2 etc etc.
It would be great if PHP can do this as It will make my life extremely easy and I dont have to resort to C++ to do this in a more complicated way.
Many thanks in advance for your help
Jay