I'm getting into sockets programming using winsock and my question is this:
I need to be able to assign a local available port on my machine so that I can use to communicate with the other end.
Does anyone know of a way to scan for which ports are currently in use so that I don't try using that one when trying to assign a port number.
Example - let's say that ports 1000 and 1001 are currently being used by other applications. I want a program to say the next available port to use would be 1002.
A short snippet of code would be very helpful.
Thanks in advance.