+$proto->set_message_cb(TestProtocol::SIMPLE, sub {
+ push @events, [ shift @_ ];
+ # send $NMSGS messages to the child, which isn't listening yet!
+ for (my $i = 0; $i < $NMSGS; $i++) {
+ $proto->send(TestProtocol::SIMPLE);
+ }
+ # and then send it SIGUSR1, so it reads those
+ kill USR1 => $pid;
+ });