Connection timed out while trying to connect through Java Socket | pressku.com

Trending 3 months ago

I person tried to link to my ubuntu server from Google Cloud utilizing Java's sockets. I runned my server and customer some connected localhost, and it worked. But erstwhile I ran it connected nan server, successful caller Socket(ip, port) creation it couldn't link by displaying java.net.ConnectException: Connection timed out: connect. I'm moving connected larboard 18934 I person tried experimenting pinch iptables and firewall by utilizing pursuing commands:

sudo iptables -A INPUT -p tcp --dport 18934 -j ACCEPT sudo ufw let 18934

And besides pinging server utilizing ping <ip>, and it displayed that server is replying.

But from my Java codification it didn't activity and I'm getting aforesaid exception. It's astir apt owed to my ubuntu configured wrongly, aliases immoderate google unreality settings that I'm not alert of. Thanks for immoderate help.

More
close