open (Net::SSH::Gateway)

    # File lib/net/ssh/gateway.rb, line 114
      def open(host, port)
        ensure_open!

        local_port = next_port

        @session_mutex.synchronize do
          @session.forward.local(local_port, host, port)
        end

        if block_given?
          begin
            yield local_port
          ensure
            close(local_port)
          end
        else
          return local_port
        end
      rescue Errno::EADDRINUSE
        retry
      end