请问IDHTTP超时的问题? ( 积分: 50 )

  • 主题发起人 主题发起人 juziling
  • 开始时间 开始时间
J

juziling

Unregistered / Unconfirmed
GUEST, unregistred user!
我在线程中获得一个网页。代码如下
IdHTTP_Thread := TIDHTTP.Create ;
IdHTTP_Thread.ConnectTimeout := 120000;
IdHTTP_Thread.ReadTimeout := 120000;

IdHTTP_Thread.ProxyParams.ProxyServer := FMain.G_ProxyServer;
IdHTTP_Thread.ProxyParams.ProxyPort := FMain.G_ProxyPort;
IdHTTP_Thread.CookieManager := FUserLogOn.IdCookieManager ;
IdHTTP_Thread.HandleRedirects := True;
try
try
strHtml := IdHTTP_Thread.Get('http://www.1234567.com/') ;
except
on E:EIdSocketError do
begin
FImpInfo :='发生错误 错误原因: '+SysErrorMessage(E.LastError );
end;
else
begin
FImpInfo := '发生错误 ';
end;
end;
finally
IdHTTP_Thread.Disconnect ;
IdHTTP_Thread.Destroy ;
end;
但有时遇到网络繁忙的时候会线程一直结束不了,停在Get()这个地方,但我设置了连接超时和读超时但没有用?
 
我在线程中获得一个网页。代码如下
IdHTTP_Thread := TIDHTTP.Create ;
IdHTTP_Thread.ConnectTimeout := 120000;
IdHTTP_Thread.ReadTimeout := 120000;

IdHTTP_Thread.ProxyParams.ProxyServer := FMain.G_ProxyServer;
IdHTTP_Thread.ProxyParams.ProxyPort := FMain.G_ProxyPort;
IdHTTP_Thread.CookieManager := FUserLogOn.IdCookieManager ;
IdHTTP_Thread.HandleRedirects := True;
try
try
strHtml := IdHTTP_Thread.Get('http://www.1234567.com/') ;
except
on E:EIdSocketError do
begin
FImpInfo :='发生错误 错误原因: '+SysErrorMessage(E.LastError );
end;
else
begin
FImpInfo := '发生错误 ';
end;
end;
finally
IdHTTP_Thread.Disconnect ;
IdHTTP_Thread.Destroy ;
end;
但有时遇到网络繁忙的时候会线程一直结束不了,停在Get()这个地方,但我设置了连接超时和读超时但没有用?
 
后退
顶部