Using Windows XP and ActiveState 8.4 w/Expect 5.43 (or is it 5.34?)
I have two scripts.
The first is a command script keeping track of several (~15) separate
Each of those 15 processes are running a single expect script. All
processes are running at the same time.
The command script keeps track of all of these processes with command
open "| tclsh expect_script.tcl" RDWR
All the command pipes (both in the command script and individual
processes) are running w/o blocking and with line buffering. The
input/output is dealt w/by fileevents.
So, when I print to stdout in one of the expect script processes it is
read in the command script, parsed, and dealt with.
_Before_ I spawn a telnet session in the expect script all communication
is as you'd expect. Anything output to stdout in the expect script
triggers a readable event in the command script, I get a line, and parse
_After_ I spawn a telnet session in the expect script this does not
happen. Everything output to stdout in the expect script is not picked
up by the command script. However, if I double up the [puts] commands,
one of the [puts] commands gets through. i.e.
If I use the above, everything works as you'd expect w/a single [puts].
I have judicious wait times (using vwait/after, so I'm in the event
loop) in both command and expect scripts. I've tried blocking mode and
different types of buffering. I've tried flushing stdout. I've tried
greater wait times. I've tried it with from 1 to 15 expect scripts
running w/o any difference.
Using [set ::exp::winnt_debug 1] I can tell that as far as the command
script is concerned, only one [puts] command is being read. In other
words, if the expect script writes out X times, the command script reads
X times, not 2 * X.
So, I'm really curious what I'm actually seeing here. Has anyone
seen/heard/some resemblance of an idea of what's going on?