![]() |
![]()
| ![]() |
![]()
NAMEAnyEvent::Connection - Base class for tcp connectful clients SYNOPSISpackage MyTCPClient; use base 'AnyEvent::Connection'; package main; my $client = MyTCPClient->new( host => 'localhost', port => 12345, ); $client->reg_cb( connected => sub { my ($client,$connection,$host,$port) = @_; # ... $client->after( $interval, sub { # Called after interval, if connection still alive } ); } connfail = sub { my ($client,$reason) = @_; # ... }, disconnect => sub { my ($client,$reason) = @_; }, error => sub { my ($client,$error) = @_; # Called in error conditions for callbackless methods }, ); $client->connect; EVENTS
OPTIONS
OPERATION METHODS
CONNECT METHODSWhen connected, there are some methods, that proxied to raw connection or to AE::Handle
For next methods there is a feature. Callback will be called in any way, either by successful processing or by error or object destruction
AUTHORMons Anderson, "<mons at cpan.org>" BUGSPlease report any bugs or feature requests to "bug-anyevent-connection at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=AnyEvent-Connection>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORTYou can find documentation for this module with the perldoc command. perldoc AnyEvent::Connection You can also look for information at:
ACKNOWLEDGEMENTSCOPYRIGHT & LICENSECopyright 2009 Mons Anderson, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|