POE::Component::Lightspeed::Client - Connects to Lightspeed servers
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!
The Lightspeed Client session
This module connects to remote Lightspeed servers. Usage is exactly the same as described in the Lightspeed documentation.
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.
PASSWORD
The password for the server, if it requires one.
This will default to nothing.
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.
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' );
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;
Nothing.
POE::Component::Lightspeed
Apocalypse <apocal@cpan.org>
Copyright 2005 by Apocalypse
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install POE::Component::Lightspeed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Lightspeed
CPAN shell
perl -MCPAN -e shell install POE::Component::Lightspeed
For more information on module installation, please visit the detailed CPAN module installation guide.