HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 120
Sharing a Multicast Port SO_REUSEPORT
![]() |
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 120 highlights
Advanced Topics for Internet Datagram Sockets Sending and Receiving IP Multicast Datagrams Note that imr_interface must match the field that was used when the IP_ADD_MEMBERSHIP socket option was specified for imr_multiaddr. Sharing a Multicast Port SO_REUSEPORT If more than one application may bind to the same port number on a system, each application must set the SO_REUSEPORT socket option before binding to the port. For example: #include int reuse = 1; setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &reuse, sizeof(reuse)); 120 Chapter 5
![](/manual_guide/products/hewlettpackard-rp5405-bsd-sockets-interface-programmers-guide-5276e7d/120.png)
120
Chapter 5
Advanced Topics for Internet Datagram Sockets
Sending and Receiving IP Multicast Datagrams
Note that
imr_interface
must match the field that was used when the
IP_ADD_MEMBERSHIP socket option was specified for
imr_multiaddr
.
Sharing a Multicast Port SO_REUSEPORT
If more than one application may bind to the same port number on a
system, each application must set the SO_REUSEPORT socket option
before
binding to the port. For example:
#include <netinet/in.h>
int reuse = 1;
setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &reuse, sizeof(reuse));