gpt4 book ai didi

sockets - 检查端口是否在 ANT 中打开

转载 作者:行者123 更新时间:2023-12-04 11:14:24 26 4
gpt4 key购买 nike

是否可以使用 ANT 任务检查端口是否打开?

我需要执行 flexunit 任务,但在开始此任务之前,我需要检查另一个 flexunit 任务是否没有运行并阻塞了所需的端口。

感谢您的任何建议,

拉法尔

最佳答案

使用 Ant 窝条件。

<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

关于sockets - 检查端口是否在 ANT 中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6535100/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com