[MPlayer-dev-eng] [PATCH] Allow UDP slave port reuse.
Matt Vollrath
matt at endpoint.com
Tue Feb 26 01:20:28 EET 2019
Fixes multiple UDP slaves on the same host fighting over a port.
===================================================================
--- udp_sync.c (revision 38124)
+++ udp_sync.c (working copy)
@@ -110,6 +110,10 @@
if (sockfd == -1)
return -1;
+ int reuse_val = 1;
+ setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuse_val,
sizeof(reuse_val));
+ setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &reuse_val,
sizeof(reuse_val));
+
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(udp_port);
More information about the MPlayer-dev-eng
mailing list