2019-06-13 17:10:51 -04:00
|
|
|
// <keep-alive>
|
|
|
|
use actix_web::{web, App, HttpResponse, HttpServer};
|
|
|
|
|
2019-06-19 00:20:50 -04:00
|
|
|
pub fn main() {
|
2019-06-13 17:10:51 -04:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
|
|
|
|
})
|
|
|
|
.keep_alive(75); // <- Set keep-alive to 75 seconds
|
|
|
|
|
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
|
|
|
|
})
|
|
|
|
.keep_alive(server::KeepAlive::Tcp(75)); // <- Use `SO_KEEPALIVE` socket option.
|
|
|
|
|
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
|
|
|
|
})
|
|
|
|
.keep_alive(None); // <- Disable keep-alive
|
|
|
|
}
|
|
|
|
// </keep-alive>
|