Trace listenning port number-VBForums
Results 1 to 2 of 2

Thread: Trace listenning port number

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004

    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.


  2. #2
    Super Moderator
    Join Date
    Dec 2003

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width