How can I wait to a certain TCP/IP port is aready taken or free

Author: BitRock Support       Date: November 21, 2008 10:19       Tags: Actions

The 'waitForPort' action is useful to wait to a service is started or stopped. This action pause the installation for a maximum timeout until a server process is listening in the specified port. For example:

<project>
    ...
    <runProgram>
        <program>/etc/init.d/mysql</program>
        <programArguments>start</programArguments>
    </runProgram>
    <waitForPort>
        <progressText>Waiting for MySQL to Start.</progressText>
        <port>3306</port>
        <state>in_use</state>
        <timeout>30000</timeout>
    </waitForPort>
    ...
</project>

You can specify the port state (in_use/free) and the timeout (in milliseconds). This action check the port and finishes when the port is free or in_use or after the timeout set.

 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up