The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

POE::Component::Lightspeed::Client - Connects to Lightspeed servers

SYNOPSIS

        use POE;
        use POE::Component::Lightspeed::Client;

        POE::Component::Lightspeed::Client->spawn(
                'ALIAS'         =>      'myclient',
                'KERNEL'        =>      'mybox',
                'ADDRESS'       =>      'localhost',
                'PORT'          =>      5634,
                'SERIALIZERS'   =>      [ qw( MySerializer Storable ) ],
                'COMPRESSION'   =>      1,
        ) or die "Unable to create Client session!";

        # Communicate with the rest of the network!

ABSTRACT

        The Lightspeed Client session

DESCRIPTION

This module connects to remote Lightspeed servers. Usage is exactly the same as described in the Lightspeed documentation.

Starting Lightspeed::Client

To start the client, just call it's spawn method:

        POE::Component::Server::SimpleHTTP->spawn(
                'ALIAS'         =>      'myclient',
                'KERNEL'        =>      'mybox',
                'ADDRESS'       =>      'localhost',
                'PORT'          =>      5634,
                'SERIALIZERS'   =>      [ qw( MySerializer Storable ) ],
                'COMPRESSION'   =>      1,
        ) or die "Unable to create Client session!";

This method will return undef on error or return success.

This constructor accepts only 8 options.

ADDRESS

The address of the remote server.

This is the only MANDATORY argument.

ALIAS

This will set the alias this client session uses in the POE Kernel.

This will default to "lightspeed_client" or "lightspeed_clientX" where x is a number sequence.

PORT

The port of the remote server.

This will default to '9876'.

KERNEL

The descriptive name of the local kernel.

This will default to $POE::Kernel::poe_kernel->ID().

SERIALIZERS

This should be an arrayref of serializers to use

This will default to: [ qw( Storable YAML ) ]

COMPRESSION

This is the boolean option passed to POE::Filter::Reference

This will default to false ( 0 )

USESSL

This is a boolean option whether to turn on SSL encryption for the link.

This will default to false ( 0 )

PASSWORD

The password for the server, if it requires one.

This will default to nothing.

Usage

The Client session will connect to the remote kernel, and allow message-passing operations to begin.

It's pretty strict about the initial connection to the server, and will shutdown immediately if it finds any errors.

Commands

There's only one command you can send: the shutdown event.

Keep in mind that you need the alias of the session if you have several of them running!

$kernel->post( 'lightspeed_client', 'shutdown' );

Notes

This module is very picky about capitalization!

All of the options are uppercase, to avoid confusion.

You can enable debugging mode by doing this:

        sub POE::Component::Lightspeed::Client::DEBUG () { 1 }
        use POE::Component::Lightspeed::Client;

EXPORT

Nothing.

SEE ALSO

POE::Component::Lightspeed

AUTHOR

Apocalypse <apocal@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2005 by Apocalypse

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