HTTP 超时

Posted CodeGear

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTTP 超时相关的知识,希望对你有一定的参考价值。

  TWinHTTPTimeouts = class(TPersistent)
  private
    FConnectTimeout, FReceiveTimeout, FSendTimeout: DWord;
  public
    procedure Assign(Source: TPersistent); override;  
  published
    property ConnectTimeout: DWord read FConnectTimeout write FConnectTimeout default 0;
    property ReceiveTimeout: DWord read FReceiveTimeout write FReceiveTimeout default 0;
    property SendTimeout: DWord read FSendTimeout write FSendTimeout default 0;
  end;

 

 

 

 

 

 

Applies to 

  WinHTTP component.  
   


Declaration 

  property WaitTimeout: Integer;  
   


Description 

  The WaitTimeout property specifies the time interval (limit), in milliseconds unit, which application able to wait until the HTTP request will be completed.  
   
  For example, if the maximum time which you can allow to complete HTTP request is 5 seconds, set this value to 5000 (milliseconds). If application can wait infinitely, set WaitTimeout to 0.  
   
  技术分享 When the timeout is expired, the component automatically terminates the HTTP request. To be notified when the WaitTimeout is expired — write OnWaitTimeoutExpired event handler.  
   


Notes 

  The WaitTimeout only works together with WaitThread property, only when it set to True.  
   


See also 

  WaitThreadThreadThreadPriority and Suspended properties;  
  Read and Abort methods;  

  OnWaitTimeoutExpired event.  

以上是关于HTTP 超时的主要内容,如果未能解决你的问题,请参考以下文章

根据图片的url地址下载图片到本地保存代码片段

HTTP客户端代码片段

应该使用啥 http 状态代码来告诉客户端会话已超时?

Ruby Net::HTTP 超时

PAT 乙级 1049 数列的片段和

HTTP requests.post 超时