NAME

POE::Class::Conn::UNIXStream - Base class for unix stream based connection classes

SYNOPSIS

# An echo server connection class
# Note that it looks almost identical to a TCP connection
# class
package My::EchoServer;

use POE qw(Class::Conn::UNIXStream);

@My::EchoServer::ISA =  qw(POE::Class::Conn::UNIXStream);

sub handler_conn_input {
    my ($self, $input) = @_[OBJECT, ARG0];
    return if $self->get_shutdown;
    print "<< $input\n";
    $self->get_wheel->put($input);
}

sub handler_start {
    $_[OBJECT]->SUPER::handler_start(@_[1 .. $#_]);
    printf "Conn session %d started\n", $_[SESSION]->ID;
}

sub handler_stop {
    $_[OBJECT]->SUPER::handler_stop(@_[1 .. $#_]);
    printf "Conn session %d stopped\n", $_[SESSION]->ID;
}

DESCRIPTION

POE::Class::Conn::UNIXStream is a base class for unix stream based connection. This is probably the most common place to subclass in order to do things with Client::* and Server::*. You would normally subclass this module, tell Client::UNIX or Server::UNIX to use your subclassed connection class. In your subclass you will need to override handler_conn_input as the default is to just croak (it is a virtual method).

This module ISA POE::Class::Conn::Stream which ISA POE::Class::Conn. You will want to see those modules for further details.

ACCESSORS

All accessors have three methods ala POE::Class::Attribs. set_ATTRIB, get_ATTRIB and ATTRIB. Set and get are obvious. ATTRIB is simply a set/get method. See POE::Class::Attribs for more details.

path

The path to the UNIX socket file.

METHODS

There are only two methods in this class. All other methods are inherited.

new

This methods sets up internal data.

DESTROY

This method simply cleans up internal data. If you override this method you need to call it in your DESTROY() method via SUPER::DESTROY or your program will leak.

TODO

Write better documentation.

AUTHOR

Scott Beck <sbeck@gossamer-threads.com>

SEE ALSO

POE POE::Class POE::Class::Conn POE::Class::Conn::Stream

1 POD Error

The following errors were encountered while parsing the POD:

Around line 107:

You forgot a '=back' before '=head1'