Skip to content

Commit

Permalink
Reuse address in bind socket
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoDios committed Sep 11, 2024
1 parent 9e09fa7 commit 4c9b126
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http/tcp_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl TcpSocket {
if !tcp_addr.is_only_v6 {
socket.set_only_v6(false)?;
}
socket.set_reuse_address(true)?;
socket.bind(&tcp_addr.sock_addr.into())?;
socket.listen(128)?;
let tcp_listener = TcpListener::from_std(socket.into())?;
Expand Down

0 comments on commit 4c9b126

Please sign in to comment.