Recommended solutions based on your search
Check if ip adress is correct, if the port is correct, and if the server is up and running and waiting for connections. Also, check if there's no firewall blocking you and if your internet connection is working.
Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.
Solutions on the web
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)