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
POEx::Role::TCPServer(3) User Contributed Perl Documentation POEx::Role::TCPServer(3)

POEx::Role::TCPServer - A Moose Role that provides TCPServer behavior

version 1.102740

POEx::Role::TCPServer bundles up the lower level SocketFactory/ReadWrite combination of wheels into a simple Moose::Role. It builds upon other POEx modules such as POEx::Role::SessionInstantiation and POEx::Types.

The events for SocketFactory for and for each ReadWrite instantiated are methods that can be advised in any way deemed fit. Advising these methods is actually encouraged and can simplify code for the consumer.

The only method that must be provided by the consuming class is handle_inbound_data.

    is: ro, isa: Str, required

This will be used as the BindAddress to SocketFactory

    is: ro, isa: Int, required

This will be used as the BindPort to SocketFactory

    is: rw, isa: Object, predicate: has_socket_factory, clearer: clear_socket_factory

The POE::Wheel::SocketFactory created in _start is stored here.

    traits: Hash, is: rw, isa: HashRef, clearer: clear_wheels

When connections are accepted, a POE::Wheel::ReadWrite object is created and stored in this attribute, keyed by WheelID. Wheels may be accessed via the following provided methods.

    {
        'get_wheel'     => 'get',
        'set_wheel'     => 'set',
        'delete_wheel'  => 'delete',
        'count_wheels'  => 'count',
        'has_wheel'     => 'exists',
    }

    is: rw, isa: Filter

This stores the filter that is used when constructing wheels. It will be cloned for each connection accepted. Defaults to a instance of POE::Filter::Line.

    is: rw, isa: Filter

If different filters are needed for input and output, supply this attribute with the input filter. It will override what is in "filter"

    is: rw, isa: Filter

If different filters are needed for input and output, supply this attribute with the output filter. It will override what is in "filter"

    is Event

shutdown unequivically terminates the TCPServer by clearing all wheels and aliases, forcing POE to garbage collect the session.

    (GlobRef $socket, Str $address, Int $port, WheelID $id) is Event

handle_on_connect is the SuccessEvent of the SocketFactory instantiated in _start.

    (Str $action, Int $code, Str $message, WheelID $id) is Event

handle_listen_error is the FailureEvent of the SocketFactory

    (Str $action, Int $code, Str $message, WheelID $id) is Event

handle_socket_error is the ErrorEvent of each POE::Wheel::ReadWrite instantiated.

    (WheelID $id) is Event

handle_on_flushed is the FlushedEvent of each POE::Wheel::ReadWrite instantiated.

    (@args) is Event

The _start event is after-advised to do the start up of the SocketFactory.

handle_inbound_data

    ($data, WheelID $id) is Event

This required method will be passed the data received, and from which wheel it came.

Nicholas Perez <nperez@cpan.org>

This software is copyright (c) 2010 by Nicholas Perez.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2010-10-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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