ptp: Set UDP sockets as non-blocking

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665>
This commit is contained in:
Sebastian Dröge 2023-05-21 12:45:14 +03:00 committed by GStreamer Marge Bot
parent b76f9c8392
commit 5a79d230ce

View file

@ -81,6 +81,9 @@ fn create_socket(port: u16) -> Result<UdpSocket, Error> {
let socket = UdpSocket::bind(SocketAddr::from((Ipv4Addr::UNSPECIFIED, port)))
.with_context(|| format!("Failed to bind socket to port {}", port))?;
socket
.set_nonblocking(true)
.context("Failed setting socket non-blocking")?;
socket.set_ttl(1).context("Failed setting TTL on socket")?;
socket
.set_multicast_ttl_v4(1)