protected function isTunnelOpen(array $tunnel)
    {
        foreach ($this->getTunnelInfo() as $info) {
            if ($this->tunnelsAreEqual($tunnel, $info)) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                if (isset($info['pid']) && function_exists('posix_kill') && !posix_kill($info['pid'], 0)) {
                    $this->debug(sprintf(
                        'The tunnel at port %d is no longer open, removing from list',
                        $info['localPort']
                    ));
                    $this->closeTunnel($info);
                    continue;
                }

                return $info;
            }
        }

        return false;
    }
protected function isTunnelOpen(array $tunnel)
    {
        foreach ($this->getTunnelInfo() as $info) {
            if ($this->tunnelsAreEqual($tunnel, $info)) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                if (isset($info['pid']) && function_exists('posix_kill') && !posix_kill($info['pid'], 0)) {
                    $this->debug(sprintf(
                        'The tunnel at port %d is no longer open, removing from list',
                        $info['localPort']
                    ));
                    $this->closeTunnel($info);
                    continue;
                }

                return $info;
            }
        }

        return false;
    }
protected function isTunnelOpen ( array $ tunnel ) { foreach ( $ this -> getTunnelInfo ( ) as $ info ) { if ( $ this -> tunnelsAreEqual ( $ tunnel , $ info ) ) { /** @noinspection PhpComposerExtensionStubsInspection */ if ( isset ( $ info [ 'pid' ] ) && function_exists ( 'posix_kill' ) && ! posix_kill ( $ info [ 'pid' ] , 0 ) ) { $ this -> debug ( sprintf ( 'The tunnel at port %d is no longer open, removing from list' , $ info [ 'localPort' ] ) ) ; $ this -> closeTunnel ( $ info ) ; continue ; } return $ info ; } } return false ; }
Check whether a tunnel is already open.

@param array $tunnel

@return bool|array
Check whether a tunnel is already open .