[英]Persistent socket/connection PHP for SMPP/SMS
我需要在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
函数pfsockopen似乎具有您正在寻找的功能。 在会话中检查这个问题-PHP pfsockopen 。
===
对您的实现的个人观察。 我假设PHP代码将由传入请求触发,而在所有其他时间,SMPP客户端将处于非活动状态。 由于以下几个原因,这可能不太适合SMPP:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.