Hi,

I would like to have multiple clients to connect to a server. Meaning that each client used a different port on the server. I'm looking for a server side code example of winsock accepting many clients but to no avail. What I've done is one client per socket.

My problem is:
How can i trace if "a port number have had opened" (or is connected by others client)? The purpose to do this is to avoid duplicate port number is assigned to the same client.
My code is generating a random port number (range from 1025 to 65534) before assign the port number to the client. I cannot gurantee if the randomly generated port number is being used by other application.

I am using VB Winsock control to do this.

Thanks!