Difference between revisions of "Shell Commands/WaitForPort"
From MorphOS Library
(Created page with "'''WaitForPort''' - Waits 10 secs for port to appear PORTNAME/A, I=INTERVAL/K/N, L=LOOP/K/N, D=DISAPPEAR/S <nowiki> PORTNAME - Name of the port to wait for...") |
|||
Line 4: | Line 4: | ||
<nowiki> | <nowiki> | ||
PORTNAME - Name of the port to wait for | PORTNAME - Name of the port to wait for | ||
− | INTERVAL - Only checks for the port every INTERVAL seconds | + | INTERVAL - Only checks for the port every INTERVAL seconds (Default=1) |
− | LOOP - Number of time to loop (Default= | + | LOOP - Number of time to loop (Default=10) |
DISAPPEAR - Check for the port to disappear instead of appear</nowiki> | DISAPPEAR - Check for the port to disappear instead of appear</nowiki> | ||
− | WaitForPort waits 10 seconds for the specified port to appear. | + | WaitForPort waits (10 seconds by default) for the specified port to appear. |
A return code of 0 indicates that the port was found. | A return code of 0 indicates that the port was found. | ||
A return code of 5 indicates that the application is not | A return code of 5 indicates that the application is not |
Latest revision as of 06:27, 12 October 2016
WaitForPort - Waits 10 secs for port to appear
PORTNAME/A, I=INTERVAL/K/N, L=LOOP/K/N, D=DISAPPEAR/S
PORTNAME - Name of the port to wait for INTERVAL - Only checks for the port every INTERVAL seconds (Default=1) LOOP - Number of time to loop (Default=10) DISAPPEAR - Check for the port to disappear instead of appear
WaitForPort waits (10 seconds by default) for the specified port to appear. A return code of 0 indicates that the port was found. A return code of 5 indicates that the application is not currently running or that the port does not exist.
Example:
MorphOS:> WaitForPort INTERVAL=1 LOOP=5 MIAMI.1
- => Waits 1 second and check for the presence of the 'MIAMI.1' port. Do that 5 times.
NOTE: Port names are case sensitive.