[PATCH] Allow UDP slave port reuse.

Matt Vollrath <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <CAHQVBFHxU2e55MN3ij4_gw9Qx1=CWAbqqEfP7144eKBYCd_5wg@mail.gmail.com>
When running multiple slave mplayers on the same machine, they fight
over binding the UDP port.  This change allows multiple slaves to bind
the same 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);
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.