Query: poe::component::connection::keepalive
OS: debian
Section: 3pm
Links: debian man pages all man pages
Forums: unix linux community forum categories
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
POE::Component::Connection::Keepalive(3pm) User Contributed Perl Documentation POE::Component::Connection::Keepalive(3pm)NAMEPOE::Component::Connection::Keepalive - a wheel wrapper around a kept-alive socketVERSIONversion 0.271SYNOPSISSee the SYNOPSIS for POE::Component::Client::Keepalive for a complete working example. my $connection = $response->{connection}; $heap->{connection} = $connection; $connection->start( InputEvent => "got_input" ); delete $heap->{connection}; # When done with it.DESCRIPTIONPOE::Component::Connection::Keepalive is a helper class for POE::Component::Client::Keepalive. It wraps managed sockets, providing a few extra features. Connection objects free their underlying sockets when they are DESTROYed. This eliminates the need to explicitly free sockets when you are done with them. Connection objects manage POE::Wheel::ReadWrite objects internally, saving a bit of effort. new Creates a new POE::Component::Connection::Keepalive instance. It accepts two parameters: A socket handle (socket) and a reference to a POE::Component::Client::Keepalive object to manage the socket when the connection is destroyed. my $conn = POE::Component::Connection::Keepalive->new( socket => $socket_handle, manager => $poe_component_client_keepalive, ); new() is usually called by a POE::Component::Client::Keepalive object. start Starts a POE::Wheel::ReadWrite object. All parameters except Handle for start() are passed directly to POE::Wheel::ReadWrite's constructor. Handle is provided by the connection object. start() returns a reference to the new POE::Wheel::ReadWrite object, but it is not necessary to save a copy of that wheel. The connection object keeps a copy of the reference internally, so the wheel will persist as long as the connection does. The POE::Wheel::ReadWrite object will be DESTROYed when the connection object is. # Asynchronous connection from Client::Keepalive. sub handle_connection { my $connection_info = $_[ARG0]; $_[HEAP]->{connection} = $connection_info->{connection}; $heap->{connection}->start( InputEvent => "got_input", ErrorEvent => "got_error", ); } # Stop the connection (and the wheel) when an error occurs. sub handle_error { delete $_[HEAP]->{connection}; } wheel Returns a reference to the internal POE::Wheel::ReadWrite object, so that methods may be called upon it. $heap->{connection}->wheel()->pause_input(); close Closes the connection immediately. Calls shutdown_input() and shutdown_output() on the wheel also.SEE ALSOPOE POE::Component::Client::Keepalive POE::Wheel::ReadWriteBUGSNone known.LICENSEThis distribution is copyright 2004-2009 by Rocco Caputo. All rights are reserved. This distribution is free software; you may redistribute it and/or modify it under the same terms as Perl itself.AUTHORRocco Caputo <rcaputo@cpan.org> Special thanks to Rob Bloodgood. perl v5.14.2 2012-05-15 POE::Component::Connection::Keepalive(3pm)
Similar Topics in the Unix Linux Community |
---|
icpld 1.1.5 (Default branch) |
How to close TELNET Connection |
Connection closing immediatly after successful login |
system, wheel and everyone |
VMware View Client Connection Issues |