GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IO::EVENT::CALLBACK (3)

.ds Aq ’

NAME



 IO::Event::Callback - A closure based API for IO::Event



CONTENTS

SYNOPSIS



 use IO::Event::Callback;

 IO::Event::Callback->new($filehanle, %callbacks);

 use IO::Event::INET::Callback;

 IO::Event::INET::Callback->new(%socket_info, %callbacks);

 use IO::Event::UNIX::Callback;

 IO::Event::UNIX::Callback->new(%socket_info, %callbacks);



DESCRIPTION

IO::Event::Callback is a wrapper around IO::Event. It provides an alternative interface to using IO::Event.

Instead of defining a class with methods like ie_input, you provide the callbacks as code references when you create the object.

The keys for the callbacks are the same as the callbacks for IO::Event with the ie_ prefix removed.

EXAMPLE



 use IO::Event::Callback;

 my $remote = IO::Event::Callback::INET->new(
        peeraddr        => 10.20.10.3,
        peerport        => 23,
        input           => sub {
                # handle input
        },
        werror          => sub {
                # handdle error
        },
        eof             => sub {
                # handle end-of-file
        },
 );



SEE ALSO

See the source for RPC::ToWorker for an exmaple use of IO::Event::Callback.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IO::EVENT::CALLBACK (3) 2011-02-01

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.