Telnet client, can't get end of message

[code]#!/usr/bin/ruby
require "socket"
require "timeout"

socket=TCPSocket.new('192.168.56.101',23)
                   puts "socket=#{socket}"

if !socket.closed?
             mes=socket.gets
end

socket.close

puts mes
[code]

Script can't finish getting message, how can i get сertain quantity of
bytes without waiting the message end ?

···

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

born in USSR wrote:

[code]#!/usr/bin/ruby
require "socket"
require "timeout"

socket=TCPSocket.new('192.168.56.101',23)
                   puts "socket=#{socket}"

if !socket.closed?
             mes=socket.gets
end

socket.close

puts mes
[code]

Script can't finish getting message, how can i get сertain quantity of
bytes without waiting the message end ?

read(10), recv(82)

···

,
,
,
,
,
,

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