SRS::EPP::Proxy::Listener - socket factory class
my $listener = SRS::EPP::Proxy::Listener->new( listen => [ "hostname:port", "address:port" ], ); # this does the listen part $listener->init; # this normally blocks, and returns a socket. # it might return undef, if you pass it a timeout. my $socket = $listener->accept;
This class is a TCP/IP listener. It listens on the configured ports for TCP connections and returns sockets when there are incoming connections waiting.
You don't actually need to supply the port or listen addresses; the defaults are to listen on INADDR_ANY (0.0.0.0) or IN6ADDR_ANY (::) on port
If the IO::Socket::INET6 module is installed, then at load time the module tries to listen on a random port on the IPv6 loopback address. If that works (or fails with a particular plausible error, if something else happened to be using that port), then IPv6 is considered to be available. This means that the RFC3493-style getaddrinfo and such are used instead of
gethostbyname. You will end up with a socket for every distinct address returned by
getaddrinfo on the passed-in list.
IPv6 addresses (not names) must be passed in square brackets, such as
In general these rules should make this listener behave like any normal IPv6-aware daemon.
Development commissioned by NZ Registry Services, and carried out by Catalyst IT - http://www.catalyst.net.nz/
Copyright 2009, 2010, NZ Registry Services. This module is licensed under the Artistic License v2.0, which permits relicensing under other Free Software licenses.