I have a .NET TCP Client that sends high volumes of messages to a (.NET async) TCP server.
I need to keep sending messages to the server but I run out of ports on the client due to TIME_WAIT.
How can a program continually and reliably send messages without using all of the available ports?
Is there a method to keep reusing the same socket. I have looked at Disconnect() and the REUSEADDRESS socket flag but cannot find any good examples of their use. In fact most sources say not to use Disconnect as it is for lower level use (i.e. it only recycles the socket handle).
I'm thinking that I need to switch to UDP or perhaps there is a method using C++ and IOCP?