Tornado 6.5 Documentation
making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. CONTENTS 1Tornado Documentation, Release 6.5.1 2 CONTENTSCHAPTER ONE QUICK LINKS making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. Tornado can be roughly divided into three major components: • A web framework (including 1.2 Asynchronous and non-Blocking I/O Real-time web features require a long-lived mostly-idle connection per user. In a traditional synchronous web server, this implies devoting one thread to each user0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
WebSockets [https://en.wikipedia.org/wiki/WebSocket], and other applications that require a long-lived connection to each user. Quick links Current version: 6.5.1 (download from PyPI [https://pypi.python.org/pypi/tornado] httpclient — Asynchronous HTTP client tornado.httputil — Manipulate HTTP headers and URLs tornado.http1connection – HTTP/1.x client/server implementation Asynchronous networking tornado.ioloop — Main event loop non-blocking socketstornado.netutil — Miscellaneous network utilities tornado.tcpclient — IOStream connection factory tornado.tcpserver — Basic IOStream-based TCP server Coroutines and concurrency tornado0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
hello 现在,在 src/main.rs 输入示例 21-1 中的代码,作为一个开始。这段代码会在地址 127.0.0.1:7878 上监听传入的 TCP 流。当获取到传入的流,它会打印出 Connection established!: 文件名:src/main.rs use std::net::TcpListener; fn main() { let listener = TcpListener::bind("127 for stream in listener.incoming() { let stream = stream.unwrap(); println!("Connection established!"); } } 示例 21-1: 监听传入的流并在接收到流时打印信息 TcpListener 用于监听 TCP 连接。我们选择监听本地地址 127.0.0 TcpListener 的 incoming 方法返回一个迭代器,它提供了一系列的流(更准确的说是 TcpStream 类型的流)。流(stream)代表一个客户端和服务端之间打开的连接。连接 (connection)代表客户端连接服务端、服务端生成响应以及服务端关闭连接的整个请求 / 响 应过程。为此,我们会从 TcpStream 读取客户端发送了什么并接着向流发送响应以向客户端发 回数据。总体来说,这个0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1