Carl,
I suspect that you need to set Timeout to a larger value than it's default
(10), eg change line 3 to something like:

	tn = Net::Telnet.new({'Host' => 'missaolondrina.org', 'Timeout' => 20) {
|str| print str }

I could reproduce your problem running the program from a Win98 client
connecting to a Debian Potato host. However, I noticed it would only fail
the first time, if I immediately re-ran the client program, then it would
connect.  That would indicate to me that the telnet daemon is probably just
a little slow responding the first time it's invoked.

Hope this helps,
Anthony

> -----Original Message-----
> From: Carl Youngblood [mailto:cyoungbl / legato.com]
> Sent: Friday, August 31, 2001 6:50 PM
> To: ruby-talk ML; undisclosed-recipients:
> Subject: [ruby-talk:20647] net/telnet problems
>
>
> I'm having a problem with the Net::Telnet class.  Any help would
> be greatly
> appreciated (I've included line numbers for ease of explanation:
>
> 1  require 'net/telnet'
> 2
> 3  tn = Net::Telnet.new({'Host' => 'missaolondrina.org'}) { |str| print
> str }
> 4  tn.login('missaolo', *** suppressed ***) { |str| print str }
> 5  tn.cmd('cd bin') { |str| print str }
> 6  tn.cmd('php -q backup.php') { |str| print str }
> 7  tn.cmd('exit')
> 8  tn.close
>
> I get this error before line 3 ever finishes:
>
> Trying missaolondrina.org...
> /cygdrive/c/ruby/lib/ruby/1.6/net/telnet.rb:325:in `open': Invalid
> argument - "c
> onnect(2)" (Errno::EINVAL)
>         from /cygdrive/c/ruby/lib/ruby/1.6/net/telnet.rb:325:in
> `initialize'
>         from /cygdrive/c/ruby/lib/ruby/1.6/net/telnet.rb:324:in `timeout'
>         from /cygdrive/c/ruby/lib/ruby/1.6/net/telnet.rb:324:in
> `initialize'
>         from runbackup.rb:3:in `new'
>         from runbackup.rb:3
>
>
> Does anybody know what I'm doing wrong?  Thanks!
>
> Carl Youngblood
>
>
>