Skip to content

Commit

Permalink
set_nonblocking to true when using from_tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
programatik29 committed Aug 5, 2022
1 parent dfafcbd commit d9681c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ async fn bind_incoming(
) -> io::Result<AddrIncoming> {
let listener = match listener {
Listener::Bind(addr) => TcpListener::bind(addr).await?,
Listener::Std(std_listener) => TcpListener::from_std(std_listener)?,
Listener::Std(std_listener) => {
std_listener.set_nonblocking(true)?;
TcpListener::from_std(std_listener)?
}
};
let mut incoming = AddrIncoming::from_listener(listener).map_err(io_other)?;

Expand Down

0 comments on commit d9681c3

Please sign in to comment.