Sprocket::Connection - Encapsulates a client or server connection
This module provides accessors and methods to handle Sprocket connections.
Connection objects are created by Sprocket::Server and Sprocket::Client and passed to Sprocket::Plugin events.
Returns an event name suitable for use with Sprocket witch pairs the event with the connection.
Send data to the connected peer. This is the same as a POE::Wheel put()
Same as send, whichever you prefer.
See POE::Kernel. $event is passed through event() for you. Returns the alarm id.
See POE::Kernel. Adjust an alarm by id.
See POE::Kernel. Removes an alarm by id.
See POE::Kernel. Removes all alarms set for this connection.
See POE::Kernel. Returns a delay id. $event is passed through event() for you.
See POE::Kernel.
Yield to an event in the same plugin.
Call an event in the same plugin.
Shortcut to $poe_kernel->post().
Accept a connection during the accept phase.
Reject a connection during the accept phase.
Close a connection after all data is flushed, unless $force is defined then the connection is closed immediately.
Reconnect to the same destination.
Returns the number of octets that haven't been written to the peer connection. See POE::Wheel::ReadWrite.
Update the connection's active time to keep it from timing out. (If a timeout is set)
Returns a callback tied to this connection. $event is passed through event() for you. Extra params (@etc) are optional.
Returns a postback tied to this connection. $event is passed through event() for you. Extra params (@etc) are optional.
Set the idle disconnect time. Set to undef to disable.
Returns the input/output filter. Normally a POE::Filter::Stackable object.
Returns the input filter. Only use this if your plugin does not use the default filter: POE::Filter::Stackable
Returns the output filter. Only use this if your plugin does not use the default filter: POE::Filter::Stackable
Returns the POE::Wheel::ReadWrite wheel for this connection.
Returns true if this connection is connected.
A dualvar containing the error number and error string ONLY after an error has occurred.
The last time this conneciton was active.
The time this connection was created.
The peer ip for this connection.
Returns an array ref of peer ips for this connection. Only for client connections. If a hostname was used during a connect and that hostname resolved to multiple 'A' records, then they are retreivable here after a remote_connected event.
The peer's port for this connection.
Combination of peer_ip:peer_port.
Peer hostname for this connection (could be an IP).
Local ip for this connection.
Local port for this connection.
Current or last conneciton state name. One of the Sprocket::Plugin event method names.
The connection's ID. The connection object stringifies to Sprocket::Connection/$ID
A hash ref stash for plugins to store information, to avoid polluting $con's own hash ref. Easily used like so: $con->x->{foo}
POE, Sprocket, Sprocket::Plugin, Sprocket::Server, Sprocket::Client
David Davis <xantus@cpan.org>
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.