Help save net neutrality! Learn more.
Close

Setting timeout after connect in HTTPRequet.j

Hao Hu
2011-02-11
2013-05-02
  • Hao Hu

    Hao Hu - 2011-02-11

    Hello everyone,
    I found a problem in HTTPRequest.java. Inside the mehtod public HTTPResponse post(String host, int port, boolean isKeepAlive). I think the setting timeout too late, and it should not set after the postSocket = new Socket(host, port); I read the jdk source code, when the socket is created with address and port, the connection will be automatically established. So I think the timeout should be set before socket connecting. Am I right? Thanks for any tips and help.
    Cheers,
    Hao

     

Log in to post a comment.