bind(): Can't assign requested address
Dave Roe
david_roe at mac.com
Mon Nov 22 22:16:37 PST 2004
thanks to all who replied.
> Please try this patch and tell me if it helps. I don't have an OS X
> machine to test it with.
>
> + memset(&addr, 0, sizeof(addr));
that seemed to solve the problem I was experiencing with bind.
Christopher's suggestion of running it without the -l option also
worked.
I am now forging ahead and using Cache::Memcached (1.14) with Perl
(5.8.0) on OS X (10.3.1) but my results so far are not good. Is there a
more suitable place to discuss the Perl API?
Basically, I am trying something like this:
use strict;
use Cache::Memcached;
my $memd = new Cache::Memcached( { servers => [ "127.0.0.1:11211" ] } );
my $key = "test_key";
my $data = $memd->get($key);
if ($data) {
print STDERR "existing data\n";
}
else {
$data = { hello => 'world' };
my $memd_set = $memd->set($key,$data);
print STDERR "memd set failed\n" unless ($memd_set);
}
What I am seeing is "Use of uninitialized value in string eq at
/opt/perl/lib/site_perl/5.8.0/Cache/Memcached.pm line 439". This is the
line:
return $res eq "STORED\r\n";
Essentially, the return value from the call to
_oneline($self,$sock,$line) on line 427 is undefined, so I still have
problems in there somewhere. It also takes about 2 seconds to complete
that subroutine call (or is this what Sean refers to as terrible kqueue
performance under non-server OS X?) or maybe what I am seeing is
actually one second for select_timeout.
What is the best way to go about debugging this? Should I be trying to
run memcached without the -d switch in some sort of verbose mode? Or
should I hack Cache/Memcached.pm and see what I can print out?
Thanks again,
/dave
More information about the memcached
mailing list