Ok, here's a quick overview of my problem and the code I am using.
Problem: I have a MultiThreaded application which kicks off any given number of threads. Each thread hits a few ASP pages, calculates the response times and I store those values. However, when executing the code below on multiple threads at the same time, the InternetReadFile function returns "<html><head><title>Error</title></head><body>The requested resource is in use. </body></html>" I haven't found any info in the MS knowledge base or MSDN lib about such an error message. If anyone knows exactly which resource this is reffering to or a way around this problem, please let me know.
Code:
PHP Code:hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, 0)
hOpenUrl = InternetOpenUrl(hOpen, sUrl, vbNullString, 0, INTERNET_FLAG_RELOAD, 0)
bDoLoop = True
While bDoLoop
sReadBuffer = vbNullString
bRet = InternetReadFile(hOpenUrl, sReadBuffer, Len(sReadBuffer), lNumberOfBytesRead)
sBuffer = sBuffer & Left(sReadBuffer, lNumberOfBytesRead)
If Not CBool(lNumberOfBytesRead) Then bDoLoop = False
Wend
If hOpenUrl <> 0 Then InternetCloseHandle (hOpenUrl)
If hOpen <> 0 Then InternetCloseHandle (hOpen)
-Thanks in advance



Reply With Quote