From: Jeremy D. Zawodny Date: Wed, 10 Jan 2001 01:38:13 +0000 (-0800) Subject: add ReusePort option to IO::Socket::INET for better multicast support (resend) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b9593b78bae68349fbe921bb0040180d11fee29;p=p5sagit%2Fp5-mst-13.2.git add ReusePort option to IO::Socket::INET for better multicast support (resend) Message-ID: <20010110013813.B41744@yahoo-inc.com> p4raw-id: //depot/perl@8397 --- diff --git a/ext/IO/lib/IO/Socket/INET.pm b/ext/IO/lib/IO/Socket/INET.pm index c922bf3..6b1bfb5 100644 --- a/ext/IO/lib/IO/Socket/INET.pm +++ b/ext/IO/lib/IO/Socket/INET.pm @@ -156,6 +156,11 @@ sub configure { 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 @@ C provides. 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