We are seeing a problem with closing a UDP socket and then trying to open a new socket which binds to the same port and IP address. We are using 2008r1 version.

We start by having a UDP socket which we bind to a specific port and our local IP address. Then we use the close() function to shut it down. Then we open a new socket and try to bind to that same port and local IP address.

In some cases the bind fails with errno=98 meaning that the address is still in use.

We are not sure why this is happening with a UDP type socket. We know this can happen with a TCP type socket and in this case use the address reuse option on the socket.

Do you have any idea on why this is happening or what can be done about it?