I need to set up a persistent socket connection in PHP and not sure how to achieve this. Currently when I send an SMS message I a) open a socket connection b) send a message (via SMS/SMPP) and c) close the socket connection
however I need to not open and close the connection all the time. Rather, I require
- 2 persistent connections that maintains connectivity to an SMSC (SMS centre) and reconnects when a timeout occurs.
- One persistent connection for reading SMS and one for sending SMS.
- Automatic restart/recovery (i.e. when memory issues arise)
- Automatic looping to act as listener for incoming events such as receiving incoming delivery receipts and sms messages, as well as 'ping' (enquire link) to keep SMPP connection alive.
UPDATE: Was wondering if anyone had achieved the above using the following: https://github.com/shaneharter/PHP-Daemon