GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  POE::COMPONENT::IRC::PLUGIN::CONNECTOR (3)

.ds Aq ’

NAME

POE::Component::IRC::Plugin::Connector - A PoCo-IRC plugin that deals with the messy business of staying connected to an IRC server

CONTENTS

SYNOPSIS



 use POE qw(Component::IRC Component::IRC::Plugin::Connector);

 my $irc = POE::Component::IRC->spawn();

 POE::Session->create(
     package_states => [
         main => [ qw(_start lag_o_meter) ],
     ],
 );

 $poe_kernel->run();

 sub _start {
     my ($kernel, $heap) = @_[KERNEL ,HEAP];
     $irc->yield( register => all );

     $heap->{connector} = POE::Component::IRC::Plugin::Connector->new();

     $irc->plugin_add( Connector => $heap->{connector} );

     $irc->yield ( connect => { Nick => testbot, Server => someserver.com } );

     $kernel->delay( lag_o_meter => 60 );
     return;
 }

 sub lag_o_meter {
     my ($kernel,$heap) = @_[KERNEL,HEAP];
     print Time:  . time() .  Lag:  . $heap->{connector}->lag() . "\n";
     $kernel->delay( lag_o_meter => 60 );
     return;
 }



DESCRIPTION

POE::Component::IRC::Plugin::Connector is a POE::Component::IRC plugin that deals with making sure that your IRC bot stays connected to the IRC network of your choice. It implements the general algorithm as demonstrated at <http://poe.perl.org/?POE_Cookbook/IRC_Bot_Reconnecting>.

METHODS

CWnew

Takes two optional arguments:

<B>’delay’B>, the frequency, in seconds, at which the plugin will ping the IRC server. Defaults to 300.

<B>’reconnect’B>, the time in seconds, to wait before trying to reconnect to the server. Defaults to 60.

<B>’servers’B>, an array reference of IRC servers to consider. Each element should be an array reference containing a server host and (optionally) a port number. The plugin will cycle through this list of servers whenever it reconnects.

Returns a plugin object suitable for use in POE::Component::IRC’s plugin_add method.

CWlag

Returns the current ’lag’ in seconds between sending PINGs to the IRC server and getting PONG responses. Probably not likely to be wholely accurate.

AUTHOR

Chris BinGOs Williams <chris@bingosnet.co.uk>

SEE ALSO

POE::Component::IRC

POE::Component::IRC::Plugin

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 POE::COMPONENT::IRC::PLUGIN::CONNECTOR (3) 2014-06-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.