mirror of
https://github.com/actix/actix-extras.git
synced 2024-12-01 02:44:37 +01:00
fix guide
This commit is contained in:
parent
05f5ba0084
commit
3dd8fdf450
@ -134,9 +134,10 @@ for full example.
|
|||||||
Actix can wait for requests on a keep-alive connection. *Keep alive*
|
Actix can wait for requests on a keep-alive connection. *Keep alive*
|
||||||
connection behavior is defined by server settings.
|
connection behavior is defined by server settings.
|
||||||
|
|
||||||
* `Some(75)` - enable 75 sec *keep alive* timer according request and response settings.
|
* `KeepAlive::Timeout(75)` - enable 75 sec *keep alive* timer according
|
||||||
* `Some(0)` - disable *keep alive*.
|
request and response settings.
|
||||||
* `None` - Use `SO_KEEPALIVE` socket option.
|
* `KeepAlive::Disabled` - disable *keep alive*.
|
||||||
|
* `KeepAlive::Tcp(75)` - Use `SO_KEEPALIVE` socket option.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
# extern crate actix_web;
|
# extern crate actix_web;
|
||||||
@ -147,7 +148,7 @@ fn main() {
|
|||||||
HttpServer::new(||
|
HttpServer::new(||
|
||||||
Application::new()
|
Application::new()
|
||||||
.resource("/", |r| r.h(httpcodes::HttpOk)))
|
.resource("/", |r| r.h(httpcodes::HttpOk)))
|
||||||
.keep_alive(None); // <- Use `SO_KEEPALIVE` socket option.
|
.keep_alive(server::KeepAlive::Tcp(75)); // <- Use `SO_KEEPALIVE` socket option.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user