Results 1 to 19 of 19

Thread: [RESOLVED]Is there a faster alternative for HTTP download? (URLDownloadToFile) urlmon

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2006
    Posts
    31

    [RESOLVED]Is there a faster alternative for HTTP download? (URLDownloadToFile) urlmon

    I am making an application that is speed-critical, and needs to download a file over HTTP and parse the download within 0.3 seconds.
    The program needs to be able to complete at least 3 cycles per second.

    The actual page being downloaded is actually a very modest 5900 bytes, but I cannot seem to get my VB application to download it any faster than 400ms, even on an 8MBps connection. Our work has an 8MB connection, so the actual environment is the same, and I am using the same disk speed (the benchmarks are around the same too).

    Can I cut the download time of 400ms to to maybe 50 - 200ms? The parser takes about 20ms, and that is simplified to a stick-figure.

    Here is my download module:

    Code:
    Public Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    
    Public Function DownloadFile() As String
    Dim lngRetVal As Long
    Dim hfile As Long
    LocalFilename = "C:\jEdit.working.temp"
    lngRetVal = URLDownloadToFile(0, strCurrentURL, LocalFilename, 0, 0)
          hfile = FreeFile
          Open LocalFilename For Input As #hfile
             DownloadFile = Input$(LOF(hfile), hfile)
          Close #hfile
    End Function
    Are there any FAST alternatives to URLDownloadToFile?

    I have tried Winsock, but the average (over 50+ tries.. I lost count) is about 800ms.

    Many thanks in advance,

    Gab
    Last edited by gabba; Nov 14th, 2006 at 06:23 PM.

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