X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FRedis.pm;h=e267ec498fd572c243175e9294445be7de1b7f12;hb=0d6dee4478f1ea28d36281cfa2d542a123a6654b;hp=55fd1a173079b4ff7365877e881a0b50fa0d652a;hpb=9868ef2b7eb6c6c726a1053e9e6f9cf5a8359a75;p=perl-Redis.git diff --git a/lib/Redis.pm b/lib/Redis.pm index 55fd1a1..e267ec4 100644 --- a/lib/Redis.pm +++ b/lib/Redis.pm @@ -117,7 +117,17 @@ sub AUTOLOAD { return 1; } - my $result = <$sock> || die "can't read socket: $!"; + my $result = <$sock>; + if ( !$result ) { + $self->{sock} = $sock = IO::Socket::INET->new( + PeerAddr => $self->{server}, + Proto => 'tcp', + ) || die $!; + + print $sock $send; + + $result = <$sock> || die "can't read socket: $!"; + } Encode::_utf8_on($result); warn "<< $result" if $self->{debug}; my $type = substr($result,0,1);