Results 1 to 6 of 6

Thread: Winsock help (please) :/

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    6

    Winsock help (please) :/

    Hi all,
    I'm trying to make a download manager that downloads files from my website. It works when I download smaller files, but large zip file come back as corrupt. Is there an explanation for this?

    Thanks

  2. #2
    Member
    Join Date
    May 2006
    Location
    UK
    Posts
    54

    Re: Winsock help (please) :/

    This is probaly down to somthing called MTU (Maximum Transmission Unit).

    This fragments data into packets of around about 1,500 Bytes so it can easily be routed across the interent. I belive to overcome this problem you need to stick all these packets together as winsock receives them. It may be easier to use the Inet control to deal with large files as it does all this automaticly.

    Hope that helps.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    6

    Re: Winsock help (please) :/

    Thanks CJ. I'm not sure if that's the route I want to go though (as i'm so far with this method). I will def. give it a look if this way doesn't work !

    I was thinking of splitting the zip file into smaller files. Does anyone know how to do this?

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

    Re: Winsock help (please) :/

    How large are the files that are failing ..?
    Last edited by rory; Jul 7th, 2006 at 11:02 PM.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    6

    Re: Winsock help (please) :/

    around 80-100MB

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

    Re: Winsock help (please) :/

    thats small .. anyway you need to add the data together as it comes in then write it to a file when it is complete

    on data arrive .. example ..

    Winsock1.GetData strData, vbString
    ReceiveData = ReceiveData & strData

    then on winsock close ..

    intFile = FreeFile
    Open TempFile For Binary As #intFile
    Put #intFile, , ReceiveData
    FileClose


    see attachment ..downloads files and webpages.. could use more done to it, but it works .. ive downloaded 400mb files with it .. i just havent had time to complete it such as customise it more with text entry boxes for URL etc ..

    you could also have them write to temp files as they are downloading and create your own auto resume program if it is paused, but ill leave that to you ;-)

    Rory
    Last edited by rory; Nov 11th, 2006 at 02:53 AM.

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