Results 1 to 4 of 4

Thread: Socket Don't Know to close

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    hongkong
    Posts
    251
    Dear Friends,

    I am using a dsSocket to download something from a website. But the connection is not closed automatically after the data has been fully received. How can I close the connection automatically. What HTTP header should be used? (HTTP 1.1 is used)

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well surely once all of the data has been received just Sock.Close ...

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    hongkong
    Posts
    251
    Originally posted by plenderj
    Well surely once all of the data has been received just Sock.Close ...

    - jamie
    Thanks for your reply. But I have tried just explicitly close the connection results in no change in the socket state. If I press the close button for twice, the error "Successful WSASARTUP not yet performed, err code 21093" occurs.

    Anything, I have tried to use an alternative method to solve the problem. I post the request to the server using HTTP 1.0 then the connection will automatically close after the data is fully transferred.

    Thanks for your help indeed.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    hongkong
    Posts
    251

    Thanks But ...

    Originally posted by plenderj
    Well surely once all of the data has been received just Sock.Close ...

    - jamie
    Thanks for your reply. But I have tried just explicitly close the connection results in no change in the socket state. If I press the close button for twice, the error "Successful WSASARTUP not yet performed, err code 21093" occurs.

    Anything, I have tried to use an alternative method to solve the problem. I post the request to the server using HTTP 1.0 then the connection will automatically close after the data is fully transferred.

    Thanks for your help indeed.

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