title: SocketTimeoutException: failed to connect to myUrl (port 80) after 7000ms - Jsoup
body: <p>In Android I have multi threads that performs <code>HTML</code> parsing using <code>Jsoup</code>.<br>
  My connection code is:</p>
  
  <pre><code>Jsoup.connect(url).userAgent(this.userAgent).timeout(10 * 1000).get();
  </code></pre>
  
  <p>where <code>this.userAgent</code> equals to the latest Mozilla user agent - <code>"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"</code>.</p>
  
  <p>Now how come I get this <code>SocketTimeoutException</code> with a parameter of 7000ms when I specify a 10000ms?<br>
  Also I tried to set the timeout to be infinite <code>timeout(0)</code> and I still get this <code>Exception</code>.</p>
  
  <p><strong>LogCat</strong>:</p>
  
  <pre><code>05-11 13:49:45.582 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err: java.net.SocketTimeoutException: failed to connect to www.songlyrics.com/23.252.119.106 (port 80) after 7000ms
  05-11 13:49:45.582 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at libcore.io.IoBridge.connectErrno(IoBridge.java:169)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at libcore.io.IoBridge.connect(IoBridge.java:122)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:456)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at java.net.Socket.connect(Socket.java:882)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.android.okhttp.internal.Platform.connectSocket(Platform.java:139)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.android.okhttp.Connection.connect(Connection.java:148)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:512)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:493)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:205)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at org.jsoup.helper.HttpConnection.get(HttpConnection.java:194)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.dl.master.lyrics.lyricsmaster.GetSongLyricsDotComResults.getParsedDocument(GetSongLyricsDotComResults.java:183)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.dl.master.lyrics.lyricsmaster.GetSongLyricsDotComResults.getSongLyricsDotComResults(GetSongLyricsDotComResults.java:87)
  05-11 13:49:45.583 11796-12561/com.dl.master.lyrics.lyricsmaster W/System.err:     at com.dl.master.lyrics.lyricsmaster.GetSongLyricsDotComResults.run(GetSongLyricsDotComResults.java:42)
  </code></pre>
  
  <p><code>getParsedDocument()</code> performing my <code>Jsoup</code> connection.</p>
  
  <p><strong>EDIT</strong>:
  Just leave the mismatched ms.</p>
  
  <p>Why I get this <code>SocketTimeoutException</code> even when i set the timeout to be infinite?</p>
  
  <p><strong>EDIT#2</strong>:</p>
  
  <p>Got to say that I'm working with <code>Jsoup</code> <code>API</code> a long time and never user <code>UserAgent</code> or <code>Timeout</code> and I decided to add them. The problems started to occur after I added the <code>UserAgent</code> and <code>Timeout</code> to my connection methods.</p>