>
> sorry about the terse code snippet....
no problem, it is good code :-)
>
> Basically, I have an SSH tunnel that is controlled by another
> process and I want to tell when that ssh tunnel is closed.
Have you or R U looking into or using IO::Socket::SSL ??
There might be a method in there to do what U want.
>
> I am checking for closed tunnels 2 ways:
>
> 1) if the process is <defunct>
>
> (i realize that the code I wrote doesnt quite illustrate
> this 2nd part... sorry)
>
> 2) if netstat -an | grep localhost:(port#) shows no
> output, then I know that the localhost port is no longer
> listening, hence the tunnel is closed.
you could play with IO::Socket to emulate this, but I don't think it will
make much of a difference.
>
> I guess my question is 2 part:
>
> 1) Id like to know if theres a better way to do this
well, there are other ways, but I don't know about better. If it works and
the performance is not a hinderance ..no need to fix it.
> 2) Is it really horribly expensive to do this with sys calls?
I don't think so. I use them quite often and rarely do I have to take em out
because of performance.
Jim
>
>