Results 1 to 3 of 3

Thread: Winsock_connect() only fires once

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Winsock_connect() only fires once

    Hello,

    I have an application, it checks for an internet connection by connecting to a website and then studying the winsock state as it changes. This successfully fires my socket_connect() sub. However, when the socket is then closed, and is used to connect to a different website for a different purpose, the _connect() event doesn't fire. Why?

    Can it only fire once or should it fire every time the socket closes and then reconnects using socket.Connect?

    Jord

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Re: Winsock_connect() only fires once

    I have found the source of the problem, somehow, Winsock must have been corrupted as whenever I try to retrieve a web page using winsock, it returns a load of strange characters, '?''s and spaces.

  3. #3
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Winsock_connect() only fires once

    You can connect and reconnect over and over .. do this for each connection

    VB Code:
    1. With Form1.Winsock1
    2.      .Close
    3.      .LocalPort = 0
    4.      .Connect RemoteHost, RemotePort
    5. End With

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