Browse Source

Add check for SO_REUSEPORT

Fixes #51
pull/76/head
emanuele-f 6 years ago
parent
commit
77392f8e53
  1. 4
      edge_utils.c

4
edge_utils.c

@ -1747,8 +1747,8 @@ int quick_edge_init(char *device_name, char *community_name,
/* allow multiple sockets to use the same PORT number */ /* allow multiple sockets to use the same PORT number */
setsockopt(eee.udp_multicast_sock, SOL_SOCKET, SO_REUSEADDR, &enable_reuse, sizeof(enable_reuse)); setsockopt(eee.udp_multicast_sock, SOL_SOCKET, SO_REUSEADDR, &enable_reuse, sizeof(enable_reuse));
#ifndef WIN32 /* no SO_REUSEPORT in Windows */ #ifdef SO_REUSEPORT /* no SO_REUSEPORT in Windows / old linux versions */
setsockopt(eee.udp_multicast_sock, SOL_SOCKET, SO_REUSEPORT, &enable_reuse, sizeof(enable_reuse)); setsockopt(eee.udp_multicast_sock, SOL_SOCKET, SO_REUSEPORT, &enable_reuse, sizeof(enable_reuse));
#endif #endif
mreq.imr_multiaddr.s_addr = inet_addr(N2N_MULTICAST_GROUP); mreq.imr_multiaddr.s_addr = inet_addr(N2N_MULTICAST_GROUP);

Loading…
Cancel
Save