Quote Originally Posted by awri View Post
...The way I have chosen to implement this is to have the client side program first query the server via a hardcoded port # for an open port for which to connect to the server. Then with the fresh port # in hand the client closes that socket, freeing it up for another client to query the server, and opens up a new socket with the dedicated port.
As mentioned by Night_Wulfe, this is not the way sockets are designed to work. A server can accept many incoming connections on the exact same port. There is no need to negotiate a separate port number for each client.

Mike