Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Telnet issue

Reply
Thread Tools

Telnet issue

 
 
Marcin Tyman
Guest
Posts: n/a
 
      07-24-2007
hi guys,
I've got issue with following:
################################################## #######
begin

t.cmd('String' => "echo -e '#{buffer}' > #{data['cfgwlan']}.tmp",
'Timeout' => 10, 'Match' => "#{data['match']}")

rescue TimeoutError, Timeout::Error => e
myLogger.error("#{__FILE__} #{__LINE__} Exception:
#{e.backtrace.join()}")
end #begin
################################################## #######
buffer - is a string
data['cfgwlan'] - is file path with file_name
t - is telnet object and works correctly with other commands.

But in this case t.cmd causes Timeout::Error exception all the time but
data['cfgwlan'] is each time is overwritten correctly. Looks like that
after
echo -e '#{buffer}' > #{data['cfgwlan']}.tmp none of prompt has been
appearing and the command ends on timeout.

What is wrong with it?

Any help would be helpful.
Thanks in advance.
MT
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Robert Dober
Guest
Posts: n/a
 
      07-24-2007
On 7/24/07, Marcin Tyman <(E-Mail Removed)> wrote:
Well I can reproduce your problem, but as I have no idea what is in
buffer it is difficult to tell what really is your problem.

buffer="$( sleep 20 )"

are things in buffer complex enough to cause that kind of problem?
You really need to tell us what is in buffer when it blocks I am afraid.

Cheers
Robert


--
I always knew that one day Smalltalk would replace Java.
I just didn't know it would be called Ruby
-- Kent Beck

 
Reply With Quote
 
 
 
 
Marcin Tyman
Guest
Posts: n/a
 
      07-24-2007
Robert Dober wrote:
> On 7/24/07, Marcin Tyman <(E-Mail Removed)> wrote:
> Well I can reproduce your problem, but as I have no idea what is in
> buffer it is difficult to tell what really is your problem.
>
> buffer="$( sleep 20 )"
>
> are things in buffer complex enough to cause that kind of problem?
> You really need to tell us what is in buffer when it blocks I am afraid.
>
> Cheers
> Robert


My stupid fault. In place of "#{data['match']}"... should be Regexp
object not string. This is why it didn't work. Now it is ok.
--
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
wanting telnet to auto logon and issue a reboot command for adsl modem ashjas Computer Support 3 09-30-2007 03:48 PM
telnet terminal issue Alex Ciarlillo Ruby 0 11-27-2006 03:40 PM
Need to talk to a telnet server and send a telnet break Jim Isaacson C Programming 5 11-05-2004 09:17 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