+# needed to tell recv_cmd1 how many times to loop IO::FDPass::recv
+sub wq_set_recv_fds {
+ return unless $recv_cmd1;
+ my $nfds = pop;
+ my $sub = sub {
+ my ($sock, $fds, undef, $flags) = @_;
+ $recv_cmd1->($sock, $fds, $_[2], $flags, $nfds);
+ };
+ my $self = pop;
+ if (ref $self) {
+ $self->{-wq_recv_cmd} = $sub;
+ } else {
+ $recv_cmd = $sub;
+ }
+}
+