C coo Unregistered / Unconfirmed GUEST, unregistred user! 2000-05-26 #1 好象没法设置超时,这样就有可能遇到死在那里出不来的情况,我想问问各位 高手,如何设置HttpCli的超时时间?
T tanglu Unregistered / Unconfirmed GUEST, unregistred user! 2000-05-26 #2 FDoneFlag := FALSE; Timeout := GetTickCount + 30000; { 30" 超时} while not FDoneFlag do begin Sleep(0); Application.ProcessMessages; if Timeout < Longint(GetTickCount) then begin HttpCli1.Abort; Result := FALSE; Exit; end; end;
FDoneFlag := FALSE; Timeout := GetTickCount + 30000; { 30" 超时} while not FDoneFlag do begin Sleep(0); Application.ProcessMessages; if Timeout < Longint(GetTickCount) then begin HttpCli1.Abort; Result := FALSE; Exit; end; end;
P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2000-05-28 #3 上面的只可用于GetAsync 用 Get 方法的话要放多一个 Timer 控件, OnTimer 事件里面HttpCli1.Abort;