- warn "[client] flushing $kids{$token}\n" if $Debug;
- $kids{$token}->flush;
- #eval { $kids{$token}->flush; };
- #die "error flushing?!?!? $@\n" if $@ ne '';
- #warn "[client] closing $kids{$token}\n";
- #close $kids{$token};
- #warn "[client] deleting $kids{$token}\n";
- #delete $kids{$token};
- warn "[client] done with $token\n" if $Debug;
+ warn "flushing to $token\n" if $Debug;
+ until ( $kids{$token}->flush ) {
+ warn "WARNING: error flushing: $!";
+ sleep 1;
+ }
+ #no close or delete here - will block waiting for child
+ warn "done with $token\n" if $Debug;