Forum information is pushed in real time

WBOY
Release: 2016-09-13 08:46:06
Original
953 people have browsed it

I would like to ask a question. I want to implement real-time push of messages in a web forum. The front and back ends are separated. The middle layer is made of node. I plan to use socket.io to establish a long connection between the client and the node, and the node does not have to keep track of the back end. To maintain a long connection, the node side provides an interface. When the backend has a message, it calls the interface and tells the node side to deliver what message to whom. How should we determine whether the client is online, that is, a long connection has been established with the node? If the corresponding user is found based on the information provided by the backend, such as user ID, and the message is delivered?

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