NAME

Sprocket::Server - The Sprocket Server

SYNOPSIS

use Sprocket qw( Server );

Sprocket::Server->spawn(
    Name => 'Test Server',
    ListenAddress => '127.0.0.1', # Defaults to 0.0.0.0
    ListenPort => 9979,           # Defaults to random port
    Plugins => [
        {
            plugin => MyPlugin->new(),
            priority => 0, # default
        },
    ],
    LogLevel => 4,
    MaxConnections => 10000,
);

DESCRIPTION

Sprocket::Server defines a TCP/IP Server, it binds to a Address and Port and listens for incoming TCP/IP connections.

METHODS

spawn( %options )

Create a new Sprocket::Server object.

OPTIONS

Name => (Str)

The Name for this server. Must be unique.

ListenPort => (Int)

The port this server listens on.

ListenAddress => (Str)

The address this server listens on.

LogLevel => (Int)

The minimum level of logging, defaults to 4

MaxConnections => (Int)

The minimum number of connections this server will handle before refusing new ones.

Plugins => (ArrayRef)

Plugins that this server will hand off processing to. In an ArrayRef of HashRef's format as so:

{
    plugin => MyPlugin->new(),
    priority => 0 # default
}
shutdown

Shutdown this server cleanly

EVENTS

These events are handled by plugins. See Sprocket::Plugin.

local_accept
local_connected
local_recieve
local_disconnected

SEE ALSO

POE, Sprocket, Sprocket::Connection, Sprocket::Plugin, Sprocket::Client

AUTHOR

David Davis <xantus@cpan.org>

RATING

Please rate this module. http://cpanratings.perl.org/rate/?distribution=Sprocket

COPYRIGHT AND LICENSE

Copyright 2006-2007 by David Davis

See Sprocket for license information.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 242:

You forgot a '=back' before '=head2'

Around line 277:

'=item' outside of any '=over'