ServerContextImpl: bind to a single interface

Allow config option EPICS_PVAS_INTF_ADDR_LIST specify a single
interface (multiple interfaces to be handled later)

Bind TCP listen and UDP sender to the interface address.
For non-windows, bind a second UDP socket to the interface
broadcast address.

Allow dynamic broadcast port
This commit is contained in:
Michael Davidsaver
2015-12-10 15:24:06 -05:00
parent 5d744dbebe
commit b3d58266a7
3 changed files with 66 additions and 10 deletions

View File

@@ -434,7 +434,7 @@ inline int sendto(int s, const char *buf, size_t len, int flags, const struct so
imreq.imr_multiaddr.s_addr = mcastAddr.ia.sin_addr.s_addr;
imreq.imr_interface.s_addr = nifAddr.ia.sin_addr.s_addr;
// join multicast group on default interface
// join multicast group on the given interface
int status = ::setsockopt(_channel, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(char*)&imreq, sizeof(struct ip_mreq));
if (status)