mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-26 19:47:43 +02:00
remove server config
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use std::{net, thread, time};
|
||||
|
||||
use actix_server::{Server, ServerConfig};
|
||||
use actix_service::{fn_cfg_factory, IntoService};
|
||||
use actix_server::Server;
|
||||
use actix_service::fn_service;
|
||||
use net2::TcpBuilder;
|
||||
|
||||
fn unused_addr() -> net::SocketAddr {
|
||||
@ -19,12 +19,7 @@ fn test_bind() {
|
||||
|
||||
thread::spawn(move || {
|
||||
Server::build()
|
||||
.bind("test", addr, move || {
|
||||
fn_cfg_factory(move |cfg: &ServerConfig| {
|
||||
assert_eq!(cfg.local_addr(), addr);
|
||||
Ok::<_, ()>((|_| Ok::<_, ()>(())).into_service())
|
||||
})
|
||||
})
|
||||
.bind("test", addr, || fn_service(|_| Ok::<_, ()>(())))
|
||||
.unwrap()
|
||||
.run()
|
||||
});
|
||||
@ -40,12 +35,7 @@ fn test_listen() {
|
||||
thread::spawn(move || {
|
||||
let lst = net::TcpListener::bind(addr).unwrap();
|
||||
Server::build()
|
||||
.listen("test", lst, move || {
|
||||
fn_cfg_factory(move |cfg: &ServerConfig| {
|
||||
assert_eq!(cfg.local_addr(), addr);
|
||||
Ok::<_, ()>((|_| Ok::<_, ()>(())).into_service())
|
||||
})
|
||||
})
|
||||
.listen("test", lst, move || fn_service(|_| Ok::<_, ()>(())))
|
||||
.unwrap()
|
||||
.run()
|
||||
});
|
||||
|
Reference in New Issue
Block a user