1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 15:40:36 +02:00

migrate to tokio 0.2.2

This commit is contained in:
Nikolay Kim
2019-12-05 16:40:24 +06:00
parent d49aca9595
commit 3a858feaec
37 changed files with 281 additions and 461 deletions

View File

@ -7,9 +7,7 @@ use std::{net, thread};
use actix_rt::{net::TcpStream, System};
use actix_server::{Server, ServerBuilder, ServiceFactory};
use net2::TcpBuilder;
use tokio_net::driver::Handle;
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use actix_macros::test;
@ -25,7 +23,8 @@ pub use actix_macros::test;
/// use actix_service::{service_fn};
/// use actix_testing::TestServer;
///
/// fn main() {
/// #[actix_rt::main]
/// async fn main() {
/// let srv = TestServer::with(|| service_fn(
/// |sock| async move {
/// println!("New connection: {:?}", sock);
@ -142,7 +141,7 @@ impl TestServerRuntime {
/// Connect to server, return tokio TcpStream
pub fn connect(&self) -> std::io::Result<TcpStream> {
TcpStream::from_std(net::TcpStream::connect(self.addr)?, &Handle::default())
TcpStream::from_std(net::TcpStream::connect(self.addr)?)
}
}