Net::Telnet and sysread()

I’m trying establish a telnet connection to I can
get a connection but Net::Telnet cannot seem to handle the output. In
reading net/telnet.rb I found out about IO#sysread so i put this
little tnet.rb file together

require ‘net/telnet’

tn =
‘Host’ => ‘’,
‘Timeout’ => 10,
‘Telnetmode’ => true) { |str| print str }

input = tn.sysread(1024 * 1024)
print("\nDisplaying Output\n ")

Now when I connect here is the output that is displayed:
E:\Ruby\mkNethackbot>ruby tnet.rb

Connected to

Displaying Output
©÷¡è ©÷ ©÷# ©÷’E:\Ruby\mkNethackbot>

As you can see from the “Displaying Output” section the data that is sending doesn’t seem readable by Net::Telnet. appears to use a scripted login instead of a standard
login/password prompt.

Any ideas?


Will S. ( )
Home Page:

When you get to your wit’s end, you’ll find God lives there.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs