- rc = bind(tcpsock, (struct sockaddr *)addresses[0], sizeof (struct sockaddr_in));
- if (rc < 0) Log_fatal("bind IPv4: %s", strerror(errno));
- rc = listen(tcpsock, 3);
- if (rc < 0) Log_fatal("listen IPv4");
- fcntl(tcpsock, F_SETFL, O_NONBLOCK);
-
- rc = bind(tcpsock6, (struct sockaddr *)addresses[1], sizeof (struct sockaddr_in6));
- if (rc < 0) Log_fatal("bind IPv6: %s", strerror(errno));
- rc = listen(tcpsock6, 3);
- if (rc < 0) Log_fatal("listen IPv6");
- fcntl(tcpsock6, F_SETFL, O_NONBLOCK);
-
- pollfds[LISTEN_SOCK].fd = tcpsock;
- pollfds[LISTEN_SOCK].events = POLLIN;
+void Server_setupUDPSockets(struct sockaddr_storage* addresses[2], struct pollfd* pollfds)
+ {
+ uint8_t yes = 1;
+ int val = 0;
+ int error = 0;
+ int sockets[2];
+ char ipv6Representation[INET6_ADDRSTRLEN];