Browse Source

Add check for SO_REUSEPORT

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

2
edge_utils.c

@ -1747,7 +1747,7 @@ 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

Loading…
Cancel
Save