diff --git a/ci/azure-cross-compile.yml b/ci/azure-cross-compile.yml index 857aeb944..8c2553c72 100644 --- a/ci/azure-cross-compile.yml +++ b/ci/azure-cross-compile.yml @@ -8,6 +8,9 @@ jobs: parameters: rust_version: stable + - script: sudo apt-get update + displayName: "apt-get update" + - script: sudo apt-get install gcc-multilib displayName: "Install gcc-multilib" diff --git a/tokio-tcp/Cargo.toml b/tokio-tcp/Cargo.toml index 5e87b9b9d..55f3e43e8 100644 --- a/tokio-tcp/Cargo.toml +++ b/tokio-tcp/Cargo.toml @@ -31,4 +31,5 @@ futures = "0.1.19" [dev-dependencies] env_logger = { version = "0.5", default-features = false } +net2 = "*" tokio = { version = "0.2.0", path = "../tokio" } diff --git a/tokio-tcp/tests/tcp.rs b/tokio-tcp/tests/tcp.rs index 48a0ffd48..b35baf464 100644 --- a/tokio-tcp/tests/tcp.rs +++ b/tokio-tcp/tests/tcp.rs @@ -80,13 +80,14 @@ fn accept2() { t.join().unwrap(); } -#[cfg(unix)] -mod unix { +#[cfg(target_os = "linux")] +mod linux { use tokio_tcp::TcpStream; use env_logger; use futures::{future, Future}; use mio::unix::UnixReady; + use net2::TcpStreamExt; use tokio_io::AsyncRead; use std::io::Write; @@ -101,6 +102,7 @@ mod unix { let addr = t!(srv.local_addr()); let t = thread::spawn(move || { let mut client = t!(srv.accept()).0; + client.set_linger(Some(Duration::from_millis(0))).unwrap(); client.write(b"hello world").unwrap(); thread::sleep(Duration::from_millis(200)); });