Handling multiple UDP sockets listening on the same endpoint
问题 I've been following (roughly) some example code here on writing a DTLS server that can handle multiple clients. In this example, which works quite well (I tried), the server listens on INADDR_ANY and port 0 . fd = socket(server_addr.ss.ss_family, SOCK_DGRAM, 0); setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const void*) &on, (socklen_t) sizeof(on)); bind(fd, (const struct sockaddr *) &server_addr, sizeof(struct sockaddr_in)) When a DGRAM is received, the server runs it through an OpenSSL method