requestID


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: requestID

  1. #1
    Sunny Guest

    requestID


    In Winsock, there is the variable requestID that is used in the ConnectRequest
    event, and by invoking Accept Winsock will accept the connection request
    from that user. Does the requestID signify more than just an ID? Can it be
    related to anything else?


    Sunny

  2. #2
    ian drake Guest

    Re: requestID


    Sunny,

    While using the winsock ocx is request ID is of little value. I believe
    the Request ID is to identify the connection request to connect to. Imagine
    a server that accepts multiple connections. In the process of raising an
    event and calling the accept method there are more connection request added
    to the buffer. This ID will now be used by winsock to determine which request
    the accept method is being called on.

    The short answer would be no. Is there a something you are trying to achieve?
    I could help you with that. The winsock control is a great tool, but there
    are many bits of information that are best NOT learned the hard way.

    Ian


    "Sunny" <sunnylll@bigpond.com> wrote:
    >
    >In Winsock, there is the variable requestID that is used in the ConnectRequest
    >event, and by invoking Accept Winsock will accept the connection request
    >from that user. Does the requestID signify more than just an ID? Can it

    be
    >related to anything else?
    >
    >
    >Sunny



  3. #3
    Sunny Guest

    Re: requestID


    Ian,

    I am working on my third Winsock based chat program, and its the first that
    uses a server-client setup with the server accepting multiple connections.
    The other two have been peer to peer.

    What I'd like to achieve is to have an alternative to IP addresses to refer
    to clients (other than nicknames of course). By that, I mean that the clients
    will not know each other by IPs, but rather the requestID.


    Sunny


    "ian drake" <ian.drake1@home.com> wrote:
    >
    >Sunny,
    >
    >While using the winsock ocx is request ID is of little value. I believe
    >the Request ID is to identify the connection request to connect to. Imagine
    >a server that accepts multiple connections. In the process of raising an
    >event and calling the accept method there are more connection request added
    >to the buffer. This ID will now be used by winsock to determine which request
    >the accept method is being called on.
    >
    >The short answer would be no. Is there a something you are trying to achieve?
    > I could help you with that. The winsock control is a great tool, but there
    >are many bits of information that are best NOT learned the hard way.
    >
    >Ian
    >
    >
    >"Sunny" <sunnylll@bigpond.com> wrote:
    >>
    >>In Winsock, there is the variable requestID that is used in the ConnectRequest
    >>event, and by invoking Accept Winsock will accept the connection request
    >>from that user. Does the requestID signify more than just an ID? Can it

    >be
    >>related to anything else?
    >>
    >>
    >>Sunny

    >



  4. #4
    ian drake Guest

    Re: requestID


    Sunny,

    Are you building a chat room like program that would obviously need to be
    server based or a instant message like program that routes messages from
    one user to a destination user?

    Building a TCP server can present new problems that you won't see in a peer
    to peer system. You must manage you connections. You're probly using the
    microsoft ocx so you have a control array. It will not manage all your connection
    for you, so you must provide all that logic. Not too big a deal. The worst
    part is that you can not trust the messages sent from the server to the clients
    is just one message. Sometimes the server will send multiple messages when
    it is under heavy load. You should encapsulate the idea of a message and
    "Pack" the message before sending it and "Unpack" it when recieving data.
    There are two classes that I normally create, cMessage and cMessages. cMessages
    would have an Add, Pack, and Unpack method. The cMessage class would have
    a generated ID value, the lenght of the message(in characters ot bytes),
    and the message. If you do not encapsulate this you will find strange errors
    under heavy loads.

    I don't think you could use the Request ID to refer to a particular user's
    connection on the server. I think you would be better off knowing the index
    of the control array, or perhaps a pointer to the particular control that
    handles the connection for that user. There are probly many ways to handle
    what you want to do.

    I'm not sure I understand exactly what your program is going to do, but I
    will post some code today so you can see an example.

    Ian

    "Sunny" <sunnylll@bigpond.com> wrote:
    >
    >Ian,
    >
    >I am working on my third Winsock based chat program, and its the first that
    >uses a server-client setup with the server accepting multiple connections.
    >The other two have been peer to peer.
    >
    >What I'd like to achieve is to have an alternative to IP addresses to refer
    >to clients (other than nicknames of course). By that, I mean that the clients
    >will not know each other by IPs, but rather the requestID.
    >
    >
    >Sunny
    >
    >
    >"ian drake" <ian.drake1@home.com> wrote:
    >>
    >>Sunny,
    >>
    >>While using the winsock ocx the request ID is of little value. I believe
    >>the Request ID is used to identify the connection request to connect to.

    Imagine
    >>a server that accepts multiple connections. In the process of raising

    an
    >>event and calling the accept method there are more connection request added
    >>to the buffer. This ID will now be used by winsock to determine which

    request
    >>the accept method is being called on.
    >>
    >>The short answer would be no. Is there a something you are trying to achieve?
    >> I could help you with that. The winsock control is a great tool, but

    there
    >>are many bits of information that are best NOT learned the hard way.
    >>
    >>Ian
    >>
    >>
    >>"Sunny" <sunnylll@bigpond.com> wrote:
    >>>
    >>>In Winsock, there is the variable requestID that is used in the ConnectRequest
    >>>event, and by invoking Accept Winsock will accept the connection request
    >>>from that user. Does the requestID signify more than just an ID? Can it

    >>be
    >>>related to anything else?
    >>>
    >>>
    >>>Sunny

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center