Is it possible to check whether a port is open using ANT tasks?
I need to execute flexunit task, but before I start this task I need to check if another flexunit task is not running and blocking the desired port.
Thank you for any suggestions,
Rafal
Check if port is open using online tools: On our main website, we have a tool that you can use just for that. you can set a target and a port number and it will tell you if this port is open or not. Why not give it a try. Go haad and test it. The advantage of n online port checker is that you are testing the port from outside of your local network.
The open port checker is a tool you can use to check your external IP address and detect open ports on your connection. This tool is useful for finding out if your port forwarding is setup correctly or if your server applications are being blocked by a firewall. This tool may also be used as a port scanner to scan your network for ports that ...
Type nc -vz (your router's IP address) (port). For example, if you wanted to see if port 25 is open on your router, and your router's IP address is 10.0.0.1, you would type nc -vz 10.0.0.1 25. 4
Let’s check whether a remote network port is open and listening or not. Open PowerShell by going to Run –> powershell tns is short for Test-NetworkConnection command. google.com is the host name. You can also put an IP address instead of the host name. You can specify the port number using the -port switch at the end of tnc command.
Use the ant socket condition.
<target name="check-port" description="Check whether Tomcat is running">
<echo message="Checking whether Tomcat is running"/>
<condition property="tomcat.running">
<socket server="${tomcat.host}" port="${tomcat.port}"/>
</condition>
</target>
http://ant.apache.org/manual/Tasks/conditions.html
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