SO_REUSEADDR with UDP sockets on Linux. It's necessary?

My bind() UDP socket is connected to port 53 (DNS). Does UDP have a TIME_WAIT state or does SO_REUSEADDR useless in UDP sockets?

+4
source share
1 answer

UDP has no connections, so there is nothing like TIME_WAIT. You do not need to use SO_REUSEADDR.

If you are listening to a broadcast or multicast address, you may need to use SO_REUSEPORT, so if there are multiple listeners on the same computer, they do not conflict. However, from what I can say, this does not exist on Linux.

+6
source

Source: https://habr.com/ru/post/1435617/


All Articles