Jan 6th, 2006, 03:28 AM
Trace listenning port number
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.
Jan 6th, 2006, 10:20 AM
Re: Trace listenning port number
Hmmm, hello there
It seems that you may be thinking a little too complex.
If you just want to make your app use mulitple connections then all you need to do (initially) is adjust you Connection_Request method, winsock will assign an unavalible ramdom port.
Try the links below should help yo out, any more questions please ask
Hope that helps you
Click Here to Expand Forum to Full Width
Survey posted by VBForums.