关于scoket通信

WBOY
Release: 2016-06-13 12:20:11
Original
914 people have browsed it

关于scoket通讯
本人帮朋友弄个移动短信群发的接口(cmpp协义的),现在发单条短信的没问题,那么问题来了,如果一下子群发大量短信的时候,是什么思路?
是不是双方建立scoket后,循环发送短信,直到全部发送完后,再关闭scoket吗。
------解决思路----------------------
思路是对的,打开,就循环写入,再关闭
建立通讯也是要花时间的
------解决思路----------------------
一般解决并发问题,个人认为不要php实时处理,建议异步处理,且为了保证负载平衡不产生高峰而导致的滚雪球现象,可以加一层消息队列,比如rabbitmq,然后再调用php脚本。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!