my $log_level = $args{log_level}||'info';
my ($kid_in, $kid_out, $kid_pid) = $self->_open($on, $log_level);
$kid_in->print(io('maint/mk-fat |')->all, "__END__\n");
+ # Need to get a handshake to indicate STDIOSetup has finished
+ # messing around with file descriptors, otherwise we can severely
+ # confuse things by sending before the dup.
my $up = <$kid_out>;
die [ failure => "Garbled response from child: $up" ]
- unless $up eq "UP\n";
+ unless $up eq "Ssyshere\n";
my $connection = Tak::ConnectionService->new(
read_fh => $kid_out, write_fh => $kid_in,
listening_service => Tak::Router->new
$0 = 'tak-stdio-node';
}
log_debug { "Node starting" };
- print $stdout "UP\n";
+ # Tell the other end that we've finished messing around with file
+ # descriptors and that it's therefore safe to start sending requests.
+ print $stdout "Ssyshere\n";
Tak->loop_until($done);
}