摘要
随着互联网技术的快速发展,基于B/S架构的实时通讯和消息推送的应用范围越来越广泛,服务器消息推送是很多应用中的一项重要功能,服务器推送技术的优劣直接影响着消息推送的效率。传统的解决方案有html refresh,定时轮询和comet,但这些实现方案存在着资源消耗大、执行效率低、服务器负担过大等缺陷。Html5中引入了websocket这一全双工通信协议,利用此技术实现的方案能够在减轻服务器负担的同时高效地对服务器消息进行实时推送。使用node.js平台和socket.io库技术设计并实现了一种基于websocket协议的服务器实时消息推送平台。运行测试结果显示能快速稳定地实现消息的实时服务器推送。
With the rapid development of Internet technology,the application scope of the real- time communication and message push based on B / S framework is becoming more and more widely,and the server message push is one of the most important functions and the server push technology has a great influence on the efficiency of message pushing. The traditional solutions,such as html refresh,timing polling and comet,have disadvantages of resource wasting,low implementation efficiency and high server burden. Html 5,employing the websocket technology,as a full- duplex communication mechanism,is implemented to decrease server burden for the message push in real time. In this paper,the real- time message push system is designed and completed by the node. js platform and socket. io technology. The running test result shows that it can implement the real- time message server push rapidly and stably.
出处
《微处理机》
2016年第3期36-39,43,共5页
Microprocessors
基金
陕西科学技术研究发展计划项目(2014K05-19)