java.net.sockettimeoutexception read timed out

 

超时时间设长一点儿即可

Socket.setSoTimeout(int timeout);

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

注意下面几个超时时间(soTimeout只有100毫秒)

    /**
     * The timeout of the read() of this socket's input stream (in milliseconds)
     
*/
    private int soTimeout = 100;

    /**
     * timeout for connect and close
     
*/
    protected long timeout = 60 * 1000;

    /**
     * retry timeout in millisecods
     
*/
    protected int retryTimeout = 60 * 1000;

    /**
     * maximum retry timeout allowed
     
*/
    protected int maxRetryTimeout = MAXRETRYTIMEOUT;

 

 

 

 

 

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2021-05-17
  • 2021-09-01
  • 2022-12-23
  • 2021-09-15
  • 2021-11-19
  • 2021-07-16
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案