Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > telnet 1.9.1

Reply
Thread Tools

telnet 1.9.1

 
 
Gaspar Brogueira
Guest
Posts: n/a
 
      03-01-2011
Hi

In the version of Ruby 1.8.7 this code works as expected

require 'rubygems'
require 'net/telnet'
$localhost = Net::Telnet.new("Host"=>"appfoca04") {|str| puts str}
$localhost.waitfor(/Connected/ ) { |response| print "Response 4
connection: " + response }


but in 1.9.1 I get the following error:

telnet.rb:5:in `<main>': undefined method `waitfor' for
#<TCPSocket:0x1efa0a0> (NoMethodError)



Any idea?

Greetings,
Gaspar Brogueira

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Justin Collins
Guest
Posts: n/a
 
      03-02-2011
On 03/01/2011 07:01 AM, Gaspar Brogueira wrote:
> Hi
>
> In the version of Ruby 1.8.7 this code works as expected
>
> require 'rubygems'
> require 'net/telnet'
> $localhost = Net::Telnet.new("Host"=>"appfoca04") {|str| puts str}
> $localhost.waitfor(/Connected/ ) { |response| print "Response 4
> connection: " + response }
>
>
> but in 1.9.1 I get the following error:
>
> telnet.rb:5:in `<main>': undefined method `waitfor' for
> #<TCPSocket:0x1efa0a0> (NoMethodError)
>
>
>
> Any idea?
>
> Greetings,
> Gaspar Brogueira
>
>


Try 1.9.2. Worked fine for me there (with a different host, of course).

-Justin

 
Reply With Quote
 
 
 
 
Gaspar Brogueira
Guest
Posts: n/a
 
      03-02-2011
> -Justin


Thanks!

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Telnet - attempting to initiate a telnet session within an established telnet session Carcarius Ruby 0 12-06-2007 03:26 AM
Need to talk to a telnet server and send a telnet break Jim Isaacson C Programming 5 11-05-2004 09:17 PM
telnetting without a telnet module Howard Perl 2 11-17-2003 07:01 PM
Perl telnet proxy Shuttermutt Perl 0 09-03-2003 10:03 PM
How can I telnet when I dont have specific access to a telnet client Jack B. Pollack Computer Support 4 07-24-2003 08:58 PM



Advertisments