I would like to have two windows applications which communicate over TCP/IP using windows sockets. In this, I want my program to automatically choose the available free port for connection establishment.
Is there a way to find the free TCP port using a C or C++ program?
To be precise, I'd like to automatically detect a free port on the Server side and let the client know the same port(to connect to server).
Thanks for your time!