=head1 DESCRIPTION

POE::Class::Net - A set of base classes to do network connections with POE

=head1 SYNOPSIS

    # a tcp server

    package My::TCPServer::Conn;
    use POE;

    use strict;
    use base 'POE::Class::Conn::TCPStream';

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

    package main;

    use POE qw(Class::Server::TCP);

    POE::Class::Server::TCP->new(
        conn_class => 'My::TCPServer::Conn',
    )->start;


    # a unix server

    package My::UNIXServer::Conn;
    use POE;

    use strict;
    use base '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);
    }

    package main;

    use POE qw(Class::Server::UNIX);

    POE::Class::Server::UNIX->new(
        conn_class => 'My::UNIXServer::Conn',
    )->start;


    # a tcp client

    package My::TCPClient::Conn;
    use POE;

    use strict;
    use base 'POE::Class::Conn::TCPStream';

    sub handler_start {
        my ($self, $kernel) = @_[OBJECT, KERNEL];
        $self->SUPER::handler_start(@_[1 .. $#_]);

        $self->get_wheel->put("hello");
    }

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

    package main;

    use POE qw(Class::Client::TCP);

    POE::Class::Client::TCP->new(
        remote_port    => 'echo',
        remote_address => 'localhost',
        conn_class     => 'My::TCPClient::Conn',
    )->start;


    # a unix client

    package My::UNIXClient::Conn;
    use POE qw(Class::Client::UNIX);

    use strict;
    use base 'POE::Class::Conn::UNIXStream';

    sub handler_start {
        my ($self, $kernel) = @_[OBJECT, KERNEL];
        $self->SUPER::handler_start(@_[1 .. $#_]);

        $self->get_wheel->put("hello");
    }

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

    package main;

    use POE qw(Class::Client::UNIX);

    POE::Class::Client::UNIX->new(
        path       => '/tmp/foo.sock',
        conn_class => 'My::UNIXClient::Conn',
    )->start;

    # can't forget this
    $poe_kernel->run;

=head1 DESCRIPTION

This is a set of base classes for writting OO socket based modules with POE.
Currently supported protocols are UNIX and TCP. There are plans to add dgram.

WARNING WARNING WARNING
This is beta code. The entire thing may change tomorrow.

=head1 TODO

Finish this document

=head1 AUTHOR

Scott Beck E<lt>sbeck@gossamer-threads.comE<gt>

=head1 SEE ALSO

=over

=item L<POE::Class::Server::TCP>

=item L<POE::Class::Server::UNIX>

=item L<POE::Class::Client::TCP>

=item L<POE::Class::Client::UNIX>

=item L<POE::Class::Conn>

=item L<POE::Class::Conn::Stream>

=item L<POE::Class::Conn::TCPStream>

=item L<POE::Class::Conn::UNIXStream>

=back

=cut

