252
|
0 |
0 |
0 |
$$self{"${type}_stream_id"} ||= $self->ioloop->client('address', $self->_gateway_address, 'port', $port, 'tls', 1, 'tls_cert', $self->cert, 'tls_key', $self->key, sub {
my($ioloop, $error, $stream) = @_;
return $self->emit('error', "${type}: $error") if $error;
$stream->on('close', sub {
delete $$self{"${type}_stream_id"};
}
);
$stream->on('error', sub {
$self->emit('error', "${type}: $_[1]");
}
);
$stream->on('drain', sub {
$self->emit('drain');
}
);
$stream->on('timeout', sub {
delete $$self{"${type}_stream_id"};
}
);
$self->$cb($stream);
}
) |