- getnameinfo(ai_ptr->ai_addr, ai_ptr->ai_addrlen, dbg_node, sizeof(dbg_node),
- dbg_service, sizeof(dbg_service),
+ /* allow multiple sockets to use the same PORT number */
+ int yes = 1;
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) {
+ ERROR("statsd plugin: setsockopt (reuseaddr): %s", STRERRNO);
+ close(fd);
+ continue;
+ }
+
+ getnameinfo(ai_ptr->ai_addr, ai_ptr->ai_addrlen, str_node, sizeof(str_node),
+ str_service, sizeof(str_service),