I need to open both FTP and Telnet sessions into a
VAX/OpenVMS V7.2 system.

Completing the FTP connection is very fast, but
completing the Telnet connection is very slow.

The FTP connection takes less than one second, but
the Telnet connection take more than 30 seconds.

From the code snippet below, am I doing anything
obviously wrong? All the variables used here are
defined previously (eg: testhost, username, password).

I do not use tn.login because the Telnet prompts are
non-UNIX-like.

...

  ftp = Net::FTP.new(testhost)
  begin
    ftp.login(username, password)
  rescue
    puts "FTP connection failed."
    exit
  end

...

  tn = Net::Telnet.new("Host"=>testhost, "Timeout"=>300)
  begin
    tn.waitfor({"Match"=>/Username: /})
    tn.cmd({"String"=>username, "Match"=>/Password: /})
    tn.cmd(password)
  rescue
    puts "Telnet connection failed."
    exit
  end

...

                       user     system      total        real
FTP      0.020000   0.010000   0.030000 (  0.861000)
Telnet   0.110000   0.020000   0.130000 ( 30.444000)