Skip to content

Commit

Permalink
test(examples): socket-config-server negated feature required
Browse files Browse the repository at this point in the history
  • Loading branch information
kolbma committed Jan 17, 2024
1 parent 42b80fa commit 67748bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/socket-config-server.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#![cfg(feature = "socket2")]
extern crate tiny_http;

#[cfg(feature = "socket2")]
use std::time::Duration;

#[cfg(feature = "socket2")]
use tiny_http::{Response, Server, ServerConfig};

#[cfg(feature = "socket2")]
fn main() -> Result<(), std::io::Error> {
let server = Server::new(ServerConfig {
addr: tiny_http::ConfigListenAddr::from_socket_addrs("0.0.0.0:8000")?,
Expand Down Expand Up @@ -35,3 +37,6 @@ fn main() -> Result<(), std::io::Error> {

Ok(())
}

#[cfg(not(feature = "socket2"))]
fn main() {}

1 comment on commit 67748bd

@kolbma
Copy link
Owner Author

@kolbma kolbma commented on 67748bd Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also relevant for tiny-http#143

Please sign in to comment.