AnyEvent
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/AnyEvent/Handle.pm view on Meta::CPAN
This callback is called when a connection has been successfully established.
The peer's numeric host and port (the socket peername) are passed as
parameters, together with a retry callback. At the time it is called the
read and write queues, EOF status, TLS status and similar properties of
the handle will have been reset.
If, for some reason, the handle is not acceptable, calling C<$retry> will
continue with the next connection target (in case of multi-homed hosts or
SRV records there can be multiple connection endpoints). The C<$retry>
callback can be invoked after the connect callback returns, i.e. one can
start a handshake and then decide to retry with the next host if the
handshake fails.
In most cases, you should ignore the C<$retry> parameter.
=item on_connect_error => $cb->($handle, $message)
This callback is called when the connection could not be
established. C<$!> will contain the relevant error code, and C<$message> a
lib/AnyEvent/Socket.pm view on Meta::CPAN
When called in void-context, AnyEvent will keep the listening socket alive
internally. In this case, there is no guarantee that the listening socket
will be cleaned up or unlinked.
In all cases, when the function returns to the caller, the socket is bound
and in listening state.
If you need more control over the listening socket, you can provide a
C<< $prepare_cb->($fh, $host, $port) >>, which is called just before the
C<listen ()> call, with the listen file handle as first argument, and IP
address and port number of the local socket endpoint as second and third
arguments.
It should return the length of the listen queue (or C<0> for the default).
Note to IPv6 users: RFC-compliant behaviour for IPv6 sockets listening on
C<::> is to bind to both IPv6 and IPv4 addresses by default on dual-stack
hosts. Unfortunately, only GNU/Linux seems to implement this properly, so
if you want both IPv4 and IPv6 listening sockets you should create the
IPv6 socket first and then attempt to bind on the IPv4 socket, but ignore
any C<EADDRINUSE> errors.
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.386 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )