Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB6 - WinHttpRequest Timouts Problem

I'm using a WebRequest in VB6 and I have the timeouts set at "5000" (5 seconds), but even after 5 seconds it is not timing out, any help is appreciated.

x:
Dim objWinHTTP
Set objWinHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")


    objWinHTTP.Open "POST", "http://twitter.com/" & TwitterUSERNAME
    objWinHTTP.SetTimeouts 5000, 5000, 5000, 5000


    Call objWinHTTP.Send(psData)
    MsgBox (objWinHTTP.Status)
    If objWinHTTP.Status <> 200 Then
    Timer.Enabled = False
    MsgBox ("D:")
    GoTo x
    End If
like image 686
Ben Avatar asked Feb 25 '23 12:02

Ben


1 Answers

you should set objWinHTTP.SetTimeouts before objWinHTTP.Open

and the four parameters you set for objWinHTTP.SetTimeouts are

Resolve, Connect, Send and Receive

So each value should be set according to that.

like image 116
Binil Avatar answered Mar 06 '23 21:03

Binil