Original commit message from CVS:
Add setsockopt SO_REUSEADDR
gst_udpsrc_init_receive (GstUDPSrc *src)
{
guint bc_val;
+ gint reuse=1;
bzero (&src->myaddr, sizeof (src->myaddr));
src->myaddr.sin_family = AF_INET; /* host byte order */
src->myaddr.sin_port = htons (src->port); /* short, network byte order */
perror("socket");
return FALSE;
}
+
+ if (setsockopt(src->sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) == -1) {
+ perror("setsockopt");
+ return FALSE;
+ }
if (bind (src->sock, (struct sockaddr *) &src->myaddr, sizeof (src->myaddr)) == -1) {
perror("bind");