mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
committed by
Carl Lerche
parent
475dabe96d
commit
940f2c3431
@@ -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"
|
||||
|
||||
|
||||
@@ -29,4 +29,5 @@ futures = "0.1.19"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = { version = "0.5", default-features = false }
|
||||
net2 = "0.2"
|
||||
tokio = "0.1.13"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extern crate env_logger;
|
||||
extern crate futures;
|
||||
extern crate mio;
|
||||
extern crate net2;
|
||||
extern crate tokio_io;
|
||||
extern crate tokio_tcp;
|
||||
|
||||
@@ -84,13 +85,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;
|
||||
@@ -105,6 +107,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));
|
||||
});
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ tokio-threadpool = { version = "0.1.14", optional = true }
|
||||
tokio-tcp = { version = "0.1.0", optional = true }
|
||||
tokio-udp = { version = "0.1.0", optional = true }
|
||||
tokio-timer = { version = "0.2.8", optional = true }
|
||||
tokio-trace-core = { version = "0.1", optional = true }
|
||||
tokio-trace-core = { version = "0.2", optional = true }
|
||||
|
||||
# Needed until `reactor` is removed from `tokio`.
|
||||
mio = { version = "0.6.14", optional = true }
|
||||
|
||||
Reference in New Issue
Block a user