Sprocket::Client - The Sprocket Client
use Sprocket qw( Client ); Sprocket::Client->spawn( Name => 'My Client', # Optional, defaults to Client ClientList => [ # Optional '127.0.0.1:9979', ], Plugins => [ { plugin => MyPlugin->new(), priority => 0, # default }, ], LogLevel => 4, );
Sprocket::Client defines a TCP/IP Client, initiates a TCP/IP connection with a server on a given IP and Port
Create a new Sprocket::Client object.
The Name for this server. This is used for logging. It is optional and defaults to 'Client'
A list of one or more servers to connect to.
The minimum level of logging, defaults to 4.
Sprocket::Logger::Basic is the default and logs to STDERR. The object must support put( $server, { v => $level, msg => $msg } ) or wrap a logging system using this format.
Plugins that this client will hand off processing to. In an array ref of hash refs format as so:
{ plugin => MyPlugin->new(), priority => 0 # default }
Sprocket will set the rlimit to this value using BSD::Resource
Connect to a remote host.
Retrieves a connection by its id.
Shutdown this client. If $type is 'soft' then soft shutdown procedure will begin. remote_shutdown will be called for each connection.
The name of the client, specified during spawn.
Session id of the controlling poe session.
UUID of the client, generated during spawn.
returns the shutdown type, ie. 'soft' if shutting down, otherwize, undef.
returns the number of connections
returns the logger object
returns a hash ref of the options passed to spawn
These events are handled by plugins. See Sprocket::Plugin.
See Sprocket for observer hook semantics.
POE, Sprocket, Sprocket::Connection, Sprocket::Plugin, Sprocket::Server, Sprocket::Server::PreFork, Sprocket::Server::UNIX, Sprocket::Logger::Basic, Sprocket::Logger::Log4perl
David Davis <xantus@cpan.org>
Please rate this module. http://cpanratings.perl.org/rate/?distribution=Sprocket
Copyright 2006-2007 by David Davis
See Sprocket for license information.
To install Sprocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sprocket
CPAN shell
perl -MCPAN -e shell install Sprocket
For more information on module installation, please visit the detailed CPAN module installation guide.