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;

 

 

 

 

 

posted on 2011-10-09 15:15  网络大豆  阅读(2832)  评论(0编辑  收藏  举报