如何使用Tornado实现WebSocket服务器?

什么是龙卷风? (What is Tornado?)

Tornado is a python web framework and asynchronous networking library. It is scalable and non-blocking. It specializes in dealing with event-driven networking. As tornado supports concurrent connections, naturally, a server can take advantage of this behavior and handle a lot of web socket connections within a single node.

Tornado是一个python Web框架和异步网络库 。 它具有可伸缩性和非阻塞性。 它专门处理事件驱动的网络。 由于龙卷风支持并发连接,自然地,服务器可以利用此行为并在单个节点内处理许多Web套接字连接。

什么是Websocket? (What is Websocket?)

WebSocket is a protocol that provides full-duplex communication channels over a single TCP connection. The behavior of the open socket makes a web connection stateless and facilitates the real-time data transfer to and from the server.

WebSocket是一种协议,可通过单个TCP连接提供全双工通信通道。 开放套接字的行为使Web连接变为无状态,并促进了与服务器之间的实时数据传输。

WebSockets are designed to be used in web-browsers and servers. A connection is opened once and messages can travel to-fro multiple times before the connection is closed.

WebSockets设计用于Web浏览器和服务器。 连接一次打开,并且消息可以在关闭连接之前往返传输多次。

安装龙卷风

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值