113
|
0 |
0 |
unless (eval {
do {
while (1) {
my($rd, undef, $err) = 'IO::Select'->select($self->{'fds'}, undef, $self->{'fds'}, 10);
if ($err and @$err) {
die 'One of the handles became invalid';
};
my $got_input;
foreach my $hnd (@$rd) {
if ($hnd == $self->{'socket'}) {
my $read = _from_to($self->{'socket'}, $self->{'pty'}, 1);
if ($read == 0) {
$self->{'pty'}->close_slave;
$self->{'pty'}->close;
};
$got_input = 1;
};
if ($hnd == $self->{'pty'}) {
_from_to($self->{'pty'}, $self->{'socket'}, 1000);
};
};
last if $got_input;
};
1
}
})
|