I have a problem similar to this question which was previously asked but my problem is different. I need to be able to see if the port is open and not blocked by a firewall automatically. All examples I found just find ports which the server can be bound to but do not check whether the port is not blocked by a firewall or not. If it is blocked by a firewall, a client not on the LAN cannot connect to the server. Does anybody have any method to do this automatically? I know you can use the CMD in Windows to check ports manually but I need to this automatically. Thanks and sorry for any confusion.
Share
This not manual but a bit outside of Java, but you can run NMAP and then read the results into java. This will help you understand what ports are open.