zoukankan      html  css  js  c++  java
  • 网络timeout区分

    ConnectTimeout

    连接建立时间,三次握手完成时间

    SocketTimeout

    数据传输过程中数据包之间间隔的最大时间

    下面重点说下SocketTimeout,比如有如下图所示的http请求

    这里写图片描述

    虽然报文(“abc”)返回总共用了6秒,如果SocketTimeout设置成4秒,实际程序执行的时候是不会抛出java.net.SocketTimeoutException: Read timed out异常的。

    因为SocketTimeout的值表示的是“a”、”b”、”c”这三个报文,每两个相邻的报文的间隔时间不能超过SocketTimeout

    ReadTimeout

    2. ReadTimeout , java 是这样解释的。 意思是已经建立连接,并开始读取服务端资源。如果到了指定的时间,没有可能的数据被客户端读取,则报异常。

    [java] view plain copy
    1. Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from Input stream when a connection is established to a resource. If the timeout expires before there is data available for read, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout.   
    2.   
    3. Some non-standard implementation of this method ignores the specified timeout. To see the read timeout set, please call getReadTimeout().  
  • 相关阅读:
    AngularJS SQL
    CSS border-collapse 属性
    AngularJS 表格
    <option> 标签的 value 属性
    AngularJS Select(选择框)
    [Leetcode] N-Queens II
    [Leetcode] N-Queens
    [Leetcode] Climbing Stairs
    [Leetcode] Linked List Cycle II
    [Leetcode] Linked List Cycle
  • 原文地址:https://www.cnblogs.com/zhaoxinshanwei/p/9071804.html
Copyright © 2011-2022 走看看