I am new to Socket programming. I am writing an application on a client machine to occassionaly make a request for some data or send some data. This exchange will take place a-periodically and in-frequently once or twice a month at best. From the research I have been doing into socket programming, I need a script whose execution never ends. Instintivelly I think that this will unnecessarily consume resources for such an in-frequent use, but PHP has no mechanism for interrupts. The ideal script would sit there doing nothing and only when communication via the port takes place, does the script wake up and execute. This in other languages would be done via an interrupt.
Can anyone propose an approach that I could take around this problem please?
Thanks
John
You might try a combined approach. Write the PHP script so that it polls/waits for a limited time and use the scheduler to run at certain times, say once every 15 minutes. I wrote a very simple socket program to talk to a medical device. It doesn’t take up a lot of resource for it to sit and wait, but if you are concerned you can limit with the technique above.