NAME
POE::Watcher::Input - watch a socket or other handle for input readiness
SYNOPSIS
# Note, this is not a complete program.
# See the distribution's examples directory.
# Request a delay notification.
$self->{req}{socket} = $socket_handle;
$self->{req}{input} = POE::Watcher::Input->new(
handle => $self->{req}{socket},
on_input => "read_from_socket",
args => \%passed_to_callbacks,
);
# Handle the delay notification.
sub read_from_socket {
my ($self, $args) = @_;
my $octets = sysread($self->{req}{handle}, my $buf = "", 65536);
...;
}
DESCRIPTION
POE::Watcher::Input watches a socket or other handle and delivers a message whenever the handle becomes ready to be read. Both the handle and the method to call are passed to POE::Watcher::Input objects at construction time.
PUBLIC METHODS
new handle => HANDLE, on_input => METHOD_NAME
construct a new POE::Watcher::Input object. The constructor takes two parameters: "handle" is the socket or other file handle to watch for input readiness. "on_input" is the name of the method in the current Stage to invoke when the handle is ready to be read from.
Destroy this object to cancel it.
BUGS
See http://thirdlobe.com/projects/poe-stage/report/1 for known issues. See http://thirdlobe.com/projects/poe-stage/newticket to report one.
SEE ALSO
POE::Watcher describes concepts that are common to all POE::Watcher classes. It's required reading in order to understand fully what's going on.
AUTHORS
Rocco Caputo <rcaputo@cpan.org>.
LICENSE
POE::Watcher::Input is Copyright 2005 by Rocco Caputo. All rights are reserved. You may use, modify, and/or distribute this module under the same terms as Perl itself.