HttpClient 4.* connectionRequestTimeout, connectionTimeOut, socketTimeOut

  1. /** 
  2.     * Returns the timeout in milliseconds used when requesting a connection 
  3.     * from the connection manager. A timeout value of zero is interpreted 
  4.     * as an infinite timeout. 
  5.     * <p> 
  6.     * A timeout value of zero is interpreted as an infinite timeout. 
  7.     * A negative value is interpreted as undefined (system default). 
  8.     * </p> 
  9.     * <p> 
  10.     * Default: {@code -1} 
  11.     * </p> 
  12.     */  
  13.    public int getConnectionRequestTimeout() {  
  14.        return connectionRequestTimeout;  
  15.    }  
  16.   
  17.    /** 
  18.     * Determines the timeout in milliseconds until a connection is established. 
  19.     * A timeout value of zero is interpreted as an infinite timeout. 
  20.     * <p> 
  21.     * A timeout value of zero is interpreted as an infinite timeout. 
  22.     * A negative value is interpreted as undefined (system default). 
  23.     * </p> 
  24.     * <p> 
  25.     * Default: {@code -1} 
  26.     * </p> 
  27.     */  
  28.    public int getConnectTimeout() {  
  29.        return connectTimeout;  
  30.    }  
  31.   
  32.    /** 
  33.     * Defines the socket timeout ({@code SO_TIMEOUT}) in milliseconds, 
  34.     * which is the timeout for waiting for data  or, put differently, 
  35.     * a maximum period inactivity between two consecutive data packets). 
  36.     * <p> 
  37.     * A timeout value of zero is interpreted as an infinite timeout. 
  38.     * A negative value is interpreted as undefined (system default). 
  39.     * </p> 
  40.     * <p> 
  41.     * Default: {@code -1} 
  42.     * </p> 
  43.     */  
  44.    public int getSocketTimeout() {  
  45.        return socketTimeout;  
  46.    }  

connectionRequestTimeout  从连接池获取连接的timeout

connectionTimeout  和服务器建立连接的timeout

socketTimeout  从服务器读取数据的timeout
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值