blank.gif (43 bytes)

Church Of The
Swimming Elephant

Search:
Index | Description | Usage | Options | Variables | Hints | Bulletproof

Advanced Programming in Expect:
A Bulletproof Interface

How It Works:

The interface uses four different transmission modes, in order:

  • 1) send the entire string and hope for the best (fastest, but least reliable)
  • 2) send the entire string using the send_slow list
  • 3) send the string in blocks of eight characters
  • 4) send the string one character at a time (slowest, but most reliable)
  • If a mode fails, the command line is cleared by sending the standard control-U, the expect buffer is cleared, and the next mode is tried.  Each mode except the last one can also have a failure tolerance set, using:
    sendGlobals(ModeXFailMax),   where X is either 1,2 or 3. 
    If this max value is set to a positive number, once the failures for that mode exceeds this value, it is no longer used.  If it is set to 0, then each mode is tried for each transmission, regardless of the number of failures.  Each of the modes uses the send_only procedure as a wrapper for exp_send.  If this procedure returns an error, it most likely means that the connection was lost, and the spawn id is checked to see if the session is still active.  The error is returned to send_expect, which in turn returns an error to the calling procedure.

    For local processes and robust remote connections, mode 1 is usually sufficient.  If the remote system is a bit slow, mode 2 may be required.  Mode 3 has proven invaluable when connected to routers and clusters which provide rudimentary terminal control.  Mode 4 is rarely required, but acts as a backup to mode 3.


    Prev
    Next
    Introduction

    Setting Up The Interface
    Using The send_expect Procedure
    How It Works
    Moving Window Snapshot Diagnostics
    Controlling The Behavior Of The Interface
    Failures
     

    Cotse.Net

    Protect yourself from cyberstalkers, identity thieves, and those who would snoop on you.
    Stop spam from invading your inbox without losing the mail you want. We give you more control over your e-mail than any other service.
    Block popups, ads, and malicious scripts while you surf the net through our anonymous proxies.
    Participate in Usenet, host your web files, easily send anonymous messages, and more, much more.
    All private, all encrypted, all secure, all in an easy to use service, and all for only $5.95 a month!

    Service Details

     
    .
    www.cotse.com
    Have you gone to church today?
    .
    All pages ©1999, 2000, 2001, 2002, 2003 Church of the Swimming Elephant unless otherwise stated
    Church of the Swimming Elephant©1999, 2000, 2001, 2002, 2003 Cotse.com.
    Cotse.com is a wholly owned subsidiary of Packetderm, LLC.

    Packetderm, LLC
    210 Park Ave #308
    Worcester, MA 01609