From: John Kaurin Date: 2001-04-24T10:11:24+09:00 Subject: [ruby-talk:14122] Re: FTP vs Telnet Connection Times "ts" wrote in message news:200104220731.f3M7Vss18193@orsay1.moulon.inra.fr... > >>>>> "D" == Dave Thomas writes: > > D> What does a command line telnet client do? > > Probably a problem with SYS$MANAGER:SYLOGIN.COM or LOGIN.COM > > It take 12 s for me > > pigeon% cat c.rb > require 'net/telnet' > require 'auth' > tn = Net::Telnet.new("Host"=>'orsay2', "Timeout"=>300, "Dump_log" => 'aa') > begin > tn.waitfor({"Match"=>/Username: /}) > tn.cmd({"String"=>$username, "Match"=>/Password: /}) > tn.cmd($password) > tn.cmd("\n") > n = 0 > tn.cmd('show syst') {|c| print c if n == 1; n+= 1} > rescue > puts "Telnet connection failed." > exit > end > pigeon% time ruby c.rb > VAX/VMS V6.1 on node ORSAY2 22-APR-2001 09:59:03.56 Uptime 12 19:02:23 > real 0m13.121s > user 0m0.110s > sys 0m0.020s > pigeon% > > VMS think that the session is interactive (i.e. F$MODE()) > > > Guy Decoux This is some (most) of the problem. SYS$MANAGER:SYLOGIN.COM and LOGIN.COM both have a SET TERMINAL/INQUIRE that are unable to determine the terminal type and thus wait for a timeout. Removing the one I have control over drops the time to 20s. Removing the other would bring me to 10s or so I would presume. The only fix I can see here is to supply the SET TERMINAL/INQUIRE some input rather than waiting, but this approach does not seem very robust. Any suggestions? Also, my installation (Windows at least, did not check UNIX) does not recognize require 'auth'. Should this be part of the normal load? Or where might I find this?