Connection issues with Perl API -- or is it just me?

M Nielsen xunker@pyxidis.org
Mon, 29 Dec 2003 03:26:16 -0700


I'm having some connection problems with using the perl API.  I know 
less than jake about socket programming, so all I've been able to track 
down is that connect(), either on line 122  or 130 of the perl API is 
failing and calling it a dead server (both issuances return nothing 
even though the demon is up and running).

The demon has been tried on two machines, Redhat 7.2 and 8 (stock UP 
kernels) with the latest versions of libevent and memcached (1.1.9) 
with poll as the method.  I've tried a simple client app from many 
other machines with the latest Perl API (on 5.6 and 5.8), both 
localhost and not, with the same result.  I can telnet and set/get 
everything by hand just fine so I don't believe the demon is the 
problem.  The test code used is simple, almost verbatim from the pod:

use strict;
use Cache::Memcached;
my $memd = new Cache::Memcached {
     'servers' => [ "127.0.0.1:11211" ],
};
die "set failed" unless ($memd->set("my_key", "Some value"));
print "my_key = " . $memd->get ('my_key') . "\n";

...with the above in my tests the die() is triggered and the "stats" 
command on the demon via telnet shows no items have been stored.  The 
Debug option shows nothing additional. The demon is invoked with:

memcached -m 10 -l 127.0.0.1 -p11211

...I have a sinking feeling it's me doing someone wrong here, but I 
can't figure out what.