sub connect {
my $self = shift;
- Dlog_debug { "Perparing to create connection with args of: $_" } @_;
+ Dlog_debug { "Preparing to create connection with args of: $_" } @_;
my ($send_to_fh, $receive_from_fh, $child_pid) = $self->_open2_for(@_);
my $channel = use_module('Object::Remote::ReadChannel')->new(
fh => $receive_from_fh
undef($channel);
});
$channel->on_close_call(sub {
+ log_trace { "Connection has been closed" };
$f->fail("Channel closed without seeing Shere: $_[0]");
undef($channel);
});
->watch_time(
%{$self->timeout},
code => sub {
-# log_warn { "Connection timed out for child pid '$child_pid'" };
-# $f->fail("Connection timed out") unless $f->is_ready;
-# undef($channel);
Dlog_trace { "Connection timeout timer has fired for child pid '$child_pid'; is_ready: $_" } $f->is_ready;
unless($f->is_ready) {
log_warn { "Connection with child pid '$child_pid' has timed out" };
- $f->fail("Connection timed out") unless $f->is_ready;
+ $f->fail("Connection timed out") unless $f->is_ready;
}
- #TODO hrm was this supposed to be conditional on the is_ready ?
- #a connection is only good for timeout seconds?
undef($channel);
+
}
);
log_trace { "connection for child pid '$child_pid' has been initialized" };