From: born in USSR Date: 2009-09-15T08:38:49+09:00 Subject: Net:Telnet cmd() stop performance > code: >> require "net/telnet" >> require 'timeout' >> >> ... >> tserv = Net::Telnet::new("Host" => $TELNET_ADDRESS, >> "Timeout" => 10, >> "Prompt" => /[$%#>] \z/n) >> >> ans=tserv.login(user_login,user_paswd) >> >> command="ping -c 4 192.168.1.2" >> ans='' >> >> err=Timeout::timeout(5) do >> tserv.cmd(command){|c| ans+=c.to_s} >> end >> puts ans >> ... if the command is "ping 192.168.1.2" application would stop. Timeout::timeout() doesn't stop performance tserv.cmd(command) in 5 seconds. How is it possible to stop performance or receive сertain quantity of bytes from telnet-server? -- Posted via http://www.ruby-forum.com/.