tornado - 求助:想开发一个1对1类似微信一样聊天的服务,该如何实现?python
高洛峰
高洛峰 2017-04-18 10:02:55
0
2
342
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all (2)
巴扎黑

After the server socket receives the connection, calling accept will generate a new socket object used to communicate with the client. So the server only needs to keep the two socket objects of you and your friend. For example, s1 and s2. Then when the server receives the message from s1. The server then sends it to your friend through s2.
This is my idea, I haven’t tried it myself. You can refer to it.

    洪涛

    Tornado officially has chatroom examples, chatroom demo

    There is also code interpretation on SF

      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!