Telnet issue

Discussion in 'Ruby' started by Marcin Tyman, Jul 24, 2007.

  1. Marcin Tyman

    Marcin Tyman Guest

    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/.
    Marcin Tyman, Jul 24, 2007
    #1
    1. Advertising

  2. Marcin Tyman

    Robert Dober Guest

    On 7/24/07, Marcin Tyman <> 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
    Robert Dober, Jul 24, 2007
    #2
    1. Advertising

  3. Marcin Tyman

    Marcin Tyman Guest

    Robert Dober wrote:
    > On 7/24/07, Marcin Tyman <> 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/.
    Marcin Tyman, Jul 24, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shuttermutt

    Perl telnet proxy

    Shuttermutt, Sep 3, 2003, in forum: Perl
    Replies:
    0
    Views:
    2,652
    Shuttermutt
    Sep 3, 2003
  2. Jim Isaacson
    Replies:
    5
    Views:
    603
    Default User
    Nov 5, 2004
  3. Alex Ciarlillo

    telnet terminal issue

    Alex Ciarlillo, Nov 27, 2006, in forum: Ruby
    Replies:
    0
    Views:
    146
    Alex Ciarlillo
    Nov 27, 2006
  4. Carcarius
    Replies:
    0
    Views:
    291
    Carcarius
    Dec 6, 2007
  5. net::telnet pm issue

    , Feb 9, 2007, in forum: Perl Misc
    Replies:
    5
    Views:
    247
    J. Gleixner
    Feb 12, 2007
Loading...

Share This Page