add SO_REUSEPORT to export list in Socket.pm for better multicast support (resend)
[p5sagit/p5-mst-13.2.git] / ext / Socket / Socket.pm
index 1fa108f..90e16e6 100644 (file)
@@ -1,7 +1,7 @@
 package Socket;
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-$VERSION = "1.71";
+our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+$VERSION = "1.72";
 
 =head1 NAME
 
@@ -111,7 +111,7 @@ to inet_aton('255.255.255.255').
 
 =item sockaddr_in SOCKADDR_IN
 
-In an array context, unpacks its SOCKADDR_IN argument and returns an array
+In a list context, unpacks its SOCKADDR_IN argument and returns an array
 consisting of (PORT, ADDRESS).  In a scalar context, packs its (PORT,
 ADDRESS) arguments as a SOCKADDR_IN and returns it.  If this is confusing,
 use pack_sockaddr_in() and unpack_sockaddr_in() explicitly.
@@ -135,7 +135,7 @@ Will croak if the structure does not have AF_INET in the right place.
 
 =item sockaddr_un SOCKADDR_UN
 
-In an array context, unpacks its SOCKADDR_UN argument and returns an array
+In a list context, unpacks its SOCKADDR_UN argument and returns an array
 consisting of (PATHNAME).  In a scalar context, packs its PATHNAME
 arguments as a SOCKADDR_UN and returns it.  If this is confusing, use
 pack_sockaddr_un() and unpack_sockaddr_un() explicitly.
@@ -160,6 +160,7 @@ have AF_UNIX in the right place.
 =cut
 
 use Carp;
+use warnings::register;
 
 require Exporter;
 use XSLoader ();
@@ -244,6 +245,9 @@ use XSLoader ();
        SCM_CREDS
        SCM_RIGHTS
        SCM_TIMESTAMP
+       SHUT_RD
+       SHUT_RDWR
+       SHUT_WR
        SOCK_DGRAM
        SOCK_RAW
        SOCK_RDM
@@ -264,6 +268,7 @@ use XSLoader ();
        SO_RCVLOWAT
        SO_RCVTIMEO
        SO_REUSEADDR
+       SO_REUSEPORT
        SO_SNDBUF
        SO_SNDLOWAT
        SO_SNDTIMEO
@@ -299,7 +304,8 @@ BEGIN {
 sub sockaddr_in {
     if (@_ == 6 && !wantarray) { # perl5.001m compat; use this && die
        my($af, $port, @quad) = @_;
-       carp "6-ARG sockaddr_in call is deprecated" if $^W;
+       warnings::warn "6-ARG sockaddr_in call is deprecated" 
+           if warnings::enabled();
        pack_sockaddr_in($port, inet_aton(join('.', @quad)));
     } elsif (wantarray) {
        croak "usage:   (port,iaddr) = sockaddr_in(sin_sv)" unless @_ == 1;
@@ -320,7 +326,6 @@ sub sockaddr_un {
     }
 }
 
-
 sub AUTOLOAD {
     my($constname);
     ($constname = $AUTOLOAD) =~ s/.*:://;
@@ -329,7 +334,7 @@ sub AUTOLOAD {
        my ($pack,$file,$line) = caller;
        croak "Your vendor has not defined Socket macro $constname, used";
     }
-    eval "sub $AUTOLOAD { $val }";
+    eval "sub $AUTOLOAD () { $val }";
     goto &$AUTOLOAD;
 }