문제

My UDP socket is bind()ing to port 53 (DNS). Does UDP have a TIME_WAIT state or is using SO_REUSEADDR pointless on UDP sockets?

도움이 되었습니까?

해결책

UDP doesn't have connections, so there's nothing analogous to TIME_WAIT. You don't need to use SO_REUSEADDR.

If you're listening on a broadcast or multicast address, you might need to use SO_REUSEPORT, so that if there are multiple listeners on the same machine they don't conflict. However, from what I can tell, this doesn't exist on Linux.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top