incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <mar...@rectangular.com>
Subject Re: [lucy-dev] [patch] for ClusterSearcher.pm
Date Tue, 15 Nov 2011 07:02:26 GMT
On Mon, Nov 14, 2011 at 10:49:33PM -0800, Dan Markham wrote:
> Non-Blocking for mortals.

LOL

The arg's backwards (should be Blocking => 0) -- it's the unusual case where
we need to actively turn something off to get what we want.  After that,
applied as r1202069, thanks for the improvement!

http://svn.apache.org/viewvc?view=revision&revision=1202069

Marvin Humphrey

> Index: ClusterSearcher.pm
> ===================================================================
> --- ClusterSearcher.pm  (revision 1202059)
> +++ ClusterSearcher.pm  (working copy)
> @@ -35,7 +35,6 @@
>  
>  use IO::Socket::INET;
>  use IO::Select;
> -use Fcntl qw( F_GETFL F_SETFL O_NONBLOCK );
>  
>  sub new {
>      my ( $either, %args ) = @_;
> @@ -54,12 +53,9 @@
>          my $sock = IO::Socket::INET->new(
>              PeerAddr => $shard,
>              Proto    => 'tcp',
> +            Blocking => 1,
>          );
>          confess("No socket: $!") unless $sock;
> -        my $flags = fcntl( $sock, F_GETFL, 0 )
> -            or confess "Can't get socket flags: $!";
> -        fcntl( $sock, F_SETFL, $flags | O_NONBLOCK )
> -            or confess "Can't set socket flags: $!";
>          push @$socks, $sock;
>      }
> 
> 
> 
> -Dan

Mime
View raw message