develooper Front page | perl.perl5.porters | Postings from January 2001

Re: [PATCH] add ReusePort option to IO::Socket::INET for better multicast support (resend)

Thread Previous
From:
Jarkko Hietaniemi
Date:
January 10, 2001 12:45
Subject:
Re: [PATCH] add ReusePort option to IO::Socket::INET for better multicast support (resend)
Message ID:
20010110144457.M10405@chaos.wustl.edu
On Wed, Jan 10, 2001 at 01:38:13AM -0800, Jeremy D. Zawodny wrote:
> This is related to the Socket.pm patch I just submitted. It adds a new
> option (ReusePort, similar to Reuse which allows address reuse) to the
> new() constructor of IO::Socket::INET.
> 
> One could make the argument that there should be a ReuseAddr parameter
> so that it's more clear than having Reuse and ReusePort. But it's not
> necessary, so I haven't made that change.

It's not "necessary" but it would certainly be nicer.  I will add
ReuseAddr as an alias for Reuse after I have applied your patches.

> The end result is that Perl is a bit more multicast friendly.
> 
> Thanks,
> 
> Jeremy
> -- 
> Jeremy D. Zawodny, <jzawodn@yahoo-inc.com>
> Technical Yahoo - Yahoo Finance
> Desk: (408) 328-7878    Fax: (408) 530-5454
> Cell: (408) 439-9951
> 
> 
> --- ext/IO/lib/IO/Socket/INET.pm.orig	Tue Jan  9 23:27:09 2001
> +++ ext/IO/lib/IO/Socket/INET.pm	Tue Jan  9 23:49:46 2001
> @@ -156,6 +156,11 @@
>  		    return _error($sock, $!, "$!");
>  	}
>  
> +	if ($arg->{ReusePort}) {
> +	    $sock->sockopt(SO_REUSEPORT,1) or
> +		    return _error($sock, $!, "$!");
> +	}
> +
>  	if($lport || ($laddr ne INADDR_ANY) || exists $arg->{Listen}) {
>  	    $sock->bind($lport || 0, $laddr) or
>  		    return _error($sock, $!, "$!");
> @@ -303,6 +308,7 @@
>      Type	Socket type                  SOCK_STREAM | SOCK_DGRAM | ...
>      Listen	Queue size for listen
>      Reuse	Set SO_REUSEADDR before binding
> +    ReusePort	Set SO_REUSEPORT before binding
>      Timeout	Timeout	value for various operations
>      MultiHomed  Try all adresses for multi-homed hosts
>  
> 

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About