I am using HttpClient to handling http requests and when I try to contect with my target server I am getting a error as
org.apache.http.conn.ConnectTimeoutException: Connect to prdalonegk.alonegk.com:9090 timed out
where prdalonegk.alonegk.com:9090
is my xmpp server
Make sure the host prdalonegk.alonegk.com
is reacheable
ping prdalonegk.alonegk.com
and that it is can accept connections on port 9090
(firewall).
If all is ok, then try to increase the connection timeout:
RequestConfig.Builder requestBuilder = RequestConfig.custom();
requestBuilder = requestBuilder.setConnectTimeout(3000L); /* in ms */
Please refere to the request builder javadocs for all the settings you may provide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With