D
Derek Fountain
I'm starting up a child process which, after a delay of a few seconds,
opens a port and waits for data on it. I want my main script - the
parent - to pause until the child is ready. I don't have access to the
source for the child, so I figured the best thing to do is wait until
the port goes ready.
Only, I'm not sure how to do that. I could system() out to netstat on
the Linux box I'm working on, but really need something more platform
independent - it should work on any form of *NIX if possible. Oh, and I
don't want to upset the child process, which is basically does: listen,
accept data, close, done.
Is there some platform independent way of checking a port is open
without actually trying to open it then closing it on success?
opens a port and waits for data on it. I want my main script - the
parent - to pause until the child is ready. I don't have access to the
source for the child, so I figured the best thing to do is wait until
the port goes ready.
Only, I'm not sure how to do that. I could system() out to netstat on
the Linux box I'm working on, but really need something more platform
independent - it should work on any form of *NIX if possible. Oh, and I
don't want to upset the child process, which is basically does: listen,
accept data, close, done.
Is there some platform independent way of checking a port is open
without actually trying to open it then closing it on success?