None available.
sub DESTROY
{ my $self = shift;
kill 9, $self->{pid}; } |
sub new
{ my ($class, %params) = @_;
return bless\% params, $class; } |
sub new_sock
{ my $self = shift;
if ($self->{domainsocket}) {
return IO::Socket::UNIX->new(Peer => $self->{domainsocket});
} else {
return IO::Socket::INET->new(PeerAddr => "127.0.0.1:$self->{port}");
} } |
sub new_udp_sock
{ my $self = shift;
return IO::Socket::INET->new(PeerAddr => '127.0.0.1',
PeerPort => $self->{udpport},
Proto => 'udp',
LocalAddr => '127.0.0.1',
LocalPort => MemcachedTest::free_port('udp'),
);
}
1; } |
sub sock
{ my $self = shift;
if ($self->{conn} && ($self->{domainsocket} || getpeername($self->{conn}))) {
return $self->{conn};
}
return $self->new_sock; } |