timeout recv on udp socket
-
When I create a udp socket and then bind to port 0 and set receive timeout to 5 seconds and then call recv it the recv does not wait 5 secs but returns immediately. When I check the error code with WSAGetLastError the error code is WSAECONNRESET. Why is the connections reset ? I am using UDP and I am not connected . What I am doing wrong ? Here are the steps again 1) Create a UDP 2) Bind to 0 3) Send something to a destination address 4) setsockopt SO_RCVTIMEO to 5 secs. 5) try to recv something within 5 secs. But here it returns WSAECONNRESET !!! What is wrong ? Orcun Colak
-
When I create a udp socket and then bind to port 0 and set receive timeout to 5 seconds and then call recv it the recv does not wait 5 secs but returns immediately. When I check the error code with WSAGetLastError the error code is WSAECONNRESET. Why is the connections reset ? I am using UDP and I am not connected . What I am doing wrong ? Here are the steps again 1) Create a UDP 2) Bind to 0 3) Send something to a destination address 4) setsockopt SO_RCVTIMEO to 5 secs. 5) try to recv something within 5 secs. But here it returns WSAECONNRESET !!! What is wrong ? Orcun Colak