Skip to content

Commit

Permalink
fix(conn): Some operating systems does not allow 0 recv buffer (#243)
Browse files Browse the repository at this point in the history
This will cause FreeBSD to fail setting up the socket. It may also be true of some other operating systems, but these are the ones I have been able to test.

It works on Windows and Linux.
  • Loading branch information
Erk- authored Jul 7, 2024
1 parent 5bbe80f commit 2e68338
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/driver/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ impl Connection {
} else {
let socket = Socket::from(udp.into_std()?);

#[cfg(not(target_os = "macos"))]
// Some operating systems does not allow setting the recv buffer to 0.
#[cfg(any(target_os = "linux", target_os = "windows"))]
socket.set_recv_buffer_size(0)?;

UdpSocket::from_std(socket.into())?
Expand Down

0 comments on commit 2e68338

Please sign in to comment.