我需要在 PHP 中建立一个持久的套接字连接,但不知道如何实现。目前,当我发送 SMS 消息时,我 a)打开套接字连接 b)发送消息(通过 SMS/SMPP)和 c)关闭套接字连接
但是我不需要一直打开和关闭连接。相反,我需要
- 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.
更新:想知道是否有人使用以下方法实现了上述目标:https ://github.com/shaneharter/PHP-Daemon