I’m building an application in which I am using Socket Programming in Java using TCP. When the server side Firewall is running, I am unable to connect to the server. So how can I make a check in Java that the Firewall is running and tell the server administrator he should turn it off.
Share
The only guaranteed way of doing it is to actually try establishing a connection to the host:port.
But again, if you are unable to connect, you can’t say that its because of firewall, it could be because of server being actually down. So you can’t really tell with conformity that the firewall is turned on.