使用ANT任务可以检查端口是否打开吗?
我需要执行flexunit任务,但在开始此任务之前,我需要检查另一个flexunit任务是否正在运行并阻塞所需的端口。
谢谢任何建议,
Rafal
使用ant socket条件。
<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>