write(spawn_id=]: broken pipe



I have written a small expect script to telnet a FreeBSD machine and
send some commands to that machine remotely, through Windows XP
machine
These commands are being sent periodically in a loop. After sending
few command , the scripts throws the following exception:


write(spawn_id=]: broken pipe
while executing
"send -s "ipfw pipe 1 config delay $mod_delay \r""
invoked from within
"expect -nobrace 1# {

for { set cycle 0 } { $cycle < $no_of_cycles } {incr
cycle } {
puts "###..."
invoked from within
"expect {
"1#" {

for { set cycle 0 } { $cycle < $no_of_cycles } {incr
cycle } {


Can anybody please let me know the cause for this.
Is this issue of the freeBSD machine or my PC. Can what can be the
workaround for this

Extract from my script:
..
..
expect {
"1#" {

for { set cycle 0 } { $cycle < $no_of_cycles } {incr
cycle } {
puts "##### CYCLE NUMBER -- $cycle #####"
while { $delay <= $max_delay } {
set mod_delay [join "$delay ms" ""]
puts stdout "\nDelay set to $mod_delay\n"

send -s "ipfw pipe 1 config delay $mod_delay
\r"
set delay [expr $delay + $incr_delay]
after $wait
}

set delay $min_delay
}
}
timeout { puts "Timeout !!!"
exp_continue }

}
..
..
..
Additional Info: I am using Dummynet application of FreeBSD to
simulate Network delays.
And these commands are used to insert variable
delays in packets received from one port and are then sent out
on another interface.

.



Relevant Pages