Results 1 to 3 of 3

Thread: Winsock: Bind and Connect

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    3

    Question

    Please, why I can't issue a connect after a bind, using winsock component from VB6 sp3?

    There is any workaround for this behavior?

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Why are you attempting to bind then connect?

    What does bind do?
    Bind tells the computer, usually a server, hey, I(the socket) am associated with this port.

    What is associcated with bind?
    Listen. After binding a socket to a port, you call the listen method, which tells the server, that this socket is listening for incoming data on this port.

    So you see bind is associated with listening, if you wish to connect a bind is not needed, only when you are listening. If you are creating a server, then connect is now being called, but rather connection requested, because your socket has received a connect request (with its bind and listen).

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    3
    I am just trying to select the local IP address (not port number) to use in a connection.

    My machine already has an IP address (used as local address by Winsock component). But, I established a RAS connection (at this moment, my machine has 2 IP address), and I want to connect using the new IP (associated to the RAS connection).

    To do that, I need to "bind" the socket to use this IP.

    When I do this, the Winsock component does not allow a "connect" action using this socket.

    Originally posted by billrogers
    Why are you attempting to bind then connect?

    What does bind do?
    Bind tells the computer, usually a server, hey, I(the socket) am associated with this port.

    What is associcated with bind?
    Listen. After binding a socket to a port, you call the listen method, which tells the server, that this socket is listening for incoming data on this port.

    So you see bind is associated with listening, if you wish to connect a bind is not needed, only when you are listening. If you are creating a server, then connect is now being called, but rather connection requested, because your socket has received a connect request (with its bind and listen).

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