Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ maintenance = { status = "actively-developed" }
all-features = true

[features]
default = ["tcp", "udp", "websocket"] # All features by default
default = ["tcp", "udp", "websocket"] # All features that are crossplatform by default
tcp = ["mio/net", "socket2"]
udp = ["mio/net", "socket2"]
websocket = ["tungstenite", "url", "tcp"]
unixsocket = ["mio/net", "socket2"] # TODO: check if this is really needed

[dependencies]
mio = { version = "0.8", features = ["os-poll"] }
Expand Down
5 changes: 5 additions & 0 deletions examples/throughput/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ fn main() {
throughput_message_io(Transport::Tcp, CHUNK);
throughput_message_io(Transport::FramedTcp, CHUNK);
throughput_message_io(Transport::Ws, CHUNK);
// for platforms that support it
#[cfg(feature = "unixsocket")]
throughput_message_io(Transport::UnixSocketStream, CHUNK);
#[cfg(feature = "unixsocket")]
throughput_message_io(Transport::UnixSocketDatagram, CHUNK);
println!();
throughput_native_udp(CHUNK);
throughput_native_tcp(CHUNK);
Expand Down
4 changes: 3 additions & 1 deletion src/adapters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ pub mod framed_tcp;
pub mod udp;
#[cfg(feature = "websocket")]
pub mod ws;
#[cfg(feature = "unixsocket" )]
pub mod unix_socket;
// Add new adapters here
// ...
// ...
Loading