1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 09:42:40 +01:00

fix guide

This commit is contained in:
Nikolay Kim 2018-03-09 21:40:51 -08:00
parent 05f5ba0084
commit 3dd8fdf450

View File

@ -134,9 +134,10 @@ for full example.
Actix can wait for requests on a keep-alive connection. *Keep alive*
connection behavior is defined by server settings.
* `Some(75)` - enable 75 sec *keep alive* timer according request and response settings.
* `Some(0)` - disable *keep alive*.
* `None` - Use `SO_KEEPALIVE` socket option.
* `KeepAlive::Timeout(75)` - enable 75 sec *keep alive* timer according
request and response settings.
* `KeepAlive::Disabled` - disable *keep alive*.
* `KeepAlive::Tcp(75)` - Use `SO_KEEPALIVE` socket option.
```rust
# extern crate actix_web;
@ -147,7 +148,7 @@ fn main() {
HttpServer::new(||
Application::new()
.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.
}
```