-
Jan 6th, 2006, 03:28 AM
#1
Thread Starter
New Member
Trace listenning port number
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!
-
Jan 6th, 2006, 10:20 AM
#2
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
http://winsockvb.com/article.php?article_id=18
http://winsockvb.com/article.php?article_id=19
Hope that helps you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|