From 503c2feb0827cc24fd7c064ddbb93642615fb602 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 1 Dec 2019 10:56:25 +0600 Subject: [PATCH] re-export net primitives --- actix-rt/Cargo.toml | 2 +- actix-rt/src/lib.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 6638316a..6d141269 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -22,7 +22,7 @@ actix-macros = "0.1.0-alpha.1" actix-threadpool = "0.2" futures = "0.3.1" -tokio = "=0.2.0-alpha.6" +tokio = { version = "=0.2.0-alpha.6", features=["tcp","uds","udp"] } tokio-executor = "=0.2.0-alpha.6" tokio-net = "=0.2.0-alpha.6" tokio-timer = "=0.3.0-alpha.6" diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index c1faaca9..cf1c359c 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -52,3 +52,15 @@ pub mod time { Interval::new(start, duration) } } + +pub mod net { + pub use tokio::net::UdpSocket; + pub use tokio::net::{TcpListener, TcpStream}; + + #[cfg(unix)] + mod unix { + pub use tokio::net::{UnixDatagram, UnixListener, UnixStream}; + } + + pub use self::unix::*; +}