Skip to content

Commit

Permalink
Merge pull request #21 from rcaputo/bingos/in6addr_any
Browse files Browse the repository at this point in the history
Enable bind for IN6ADDR_ANY
  • Loading branch information
rcaputo committed Feb 23, 2015
2 parents ee3a450 + 2e4f77a commit 4feeb50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/POE/Wheel/SocketFactory.pm
Expand Up @@ -788,11 +788,17 @@ sub new {
# Need to check lengths in octets, not characters.
BEGIN { eval { require bytes } and bytes->import; }

# Undef $bind_address if IN6ADDR_ANY and handle with AI_PASSIVE
if ( $bind_address eq '::' || $bind_address eq "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ) {
$bind_address = undef;
}

# Resolve the bind address.
my ($error, @addresses) = getaddrinfo(
$bind_address, $bind_port, {
family => $self->[MY_SOCKET_DOMAIN],
socktype => $self->[MY_SOCKET_TYPE],
( defined $bind_address ? () : ( flags => 1 ) ),
}
);

Expand Down

0 comments on commit 4feeb50

Please sign in to comment.