mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2025-03-14 19:30:29 +08:00
Update Ch20
This commit is contained in:
parent
f335473dd9
commit
b485dcaf98
@ -471,3 +471,8 @@ fn handle_conn(mut stream: TcpStream) {
|
||||
相当棒!现在咱们就有了一个以差不多 40 行 Rust 代码编写的,以一个内容页面响应一个到 `/` 的请求,并以一个 `404` 响应回应全部其他请求的简单 web 服务器了。
|
||||
|
||||
当前,咱们的服务器是运行在单线程下的,意味着其只能一次服务一个请求。接下来就要通过模拟一下低速请求,检查那怎样会称为一个问题。随后咱们将修复这个问题,从而让咱们的服务器可以一次处理多个请求。
|
||||
|
||||
|
||||
## 将咱们的单线程服务器改写为多线程服务器
|
||||
|
||||
**Turning Our Single-Thread Server into a Multithreaded Server**
|
||||
|
Loading…
Reference in New Issue
Block a user