[Ofmfwg] Testing a port is on Linux with a Bash call

Aguilar, Michael J. mjaguil at sandia.gov
Thu Sep 2 12:40:28 PDT 2021


Guys

I ran across this issue with some code I was writing.  I thought it might come in handy with the Agent, as it needs to wait for Zephyr to come up.  It is Bash, running netcat.  So, you would call it from Python using a System command.

There are a few ways to accomplish the wait, but just-in-case, here is one way…..

Mike


while ! exit | nc localhost <port>; do sleep .1; done



Or, inside a function, though it probably won’t work in Python calls



while ! return | nc localhost 8008; do sleep .1; done





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofmfwg/attachments/20210902/5dc03301/attachment.htm>


More information about the Ofmfwg mailing list