| AnyEvent::TFTPd::CheckConnections - Role for AnyEvent::TFTPd for timeout checking |
AnyEvent::TFTPd::CheckConnections - Role for AnyEvent::TFTPd for timeout checking
This Moose role can be applied to the AnyEvent::TFTPd manpage which again will provide an AnyEvent timer to check for timed out connections. See also the MooseX::Traits manpage for ways to construct this object with this role applied.
use AnyEvent::TFTPd; use AnyEvent::TFTPd::CheckConnections;
my $tftpd = AnyEvent::TFTPd->new(...);
# apply to all instances of AnyEvent::TFTPd AnyEvent::TFTPd::CheckConnections->meta->apply(AnyEvent::TFTPd->meta);
# apply only two this instance AnyEvent::TFTPd::CheckConnections->meta->apply($tftpd);
$tftpd->setup(timeout => 10); # unless set in constructor
Holds the timeout set in either constructor or when calling setup().
This method modifier will start the timed event which calls check_connections().
Will loop through all connections to see if any has timed out. If so, decrease the number of retries and retry sending the data to peer if any retries are possible. If not, remove the connection.
It is very important that the the AnyEvent::TFTPd manpage object does not have too many connections, since it will cause this loop to stall the program. When that is said, the number of connections will probably cause problems to the rest of the program, before slowing down this method.
See the AnyEvent::TFTPd manpage.
| AnyEvent::TFTPd::CheckConnections - Role for AnyEvent::TFTPd for timeout checking |