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::CONSOLE (3)

.ds Aq ’

NAME

POE::Component::IRC::Plugin::Console - A PoCo-IRC plugin that provides a lightweight debugging and control console for your bot

CONTENTS

SYNOPSIS



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

 my $nickname = Flibble . $$;
 my $ircname = Flibble the Sailor Bot;
 my $ircserver = irc.blahblahblah.irc;
 my $port = 6667;
 my $bindport = 6969;

 my @channels = ( #Blah, #Foo, #Bar );

 my $irc = POE::Component::IRC->spawn(
     nick => $nickname,
     server => $ircserver,
     port => $port,
     ircname => $ircname,
 ) or die "Oh noooo! $!";

 POE::Session->create(
     package_states => [
         main => [ qw(_start irc_001 irc_console_service irc_console_connect
             irc_console_authed irc_console_close irc_console_rw_fail) ],
         ],
 );

 $poe_kernel->run();

 sub _start {
     $irc->plugin_add( Console => POE::Component::IRC::Plugin::Console->new(
         bindport => $bindport,
         password => opensesame
     );
     $irc->yield( register => all );
     $irc->yield( connect => { } );
     return;
  }

 sub irc_001 {
     $irc->yield( join => $_ ) for @channels;
     return;
 }

 sub irc_console_service {
     my $getsockname = $_[ARG0];
     return;
 }

 sub irc_console_connect {
     my ($peeradr, $peerport, $wheel_id) = @_[ARG0 .. ARG2];
     return;
 }

 sub irc_console_authed {
     my $wheel_id = $_[ARG0];
     return;
 }

 sub irc_console_close {
     my $wheel_id = $_[ARG0];
     return;
 }

 sub irc_console_rw_fail {
     my ($peeradr, $peerport) = @_[ARG0, ARG1];
     return;
 }



DESCRIPTION

POE::Component::IRC::Plugin::Console is a POE::Component::IRC plugin that provides an interactive console running over the loopback network. One connects to the listening socket using a telnet client (or equivalent), authenticate using the applicable password. Once authed one will receive all events that are processed through the component. One may also issue all the documented component commands.

METHODS

CWnew

Takes two arguments:

<B>’password’B>, the password to set for *all* console connections;

<B>’bindport’B>, specify a particular port to bind to, defaults to 0, ie. randomly allocated;

Returns a plugin object suitable for feeding to POE::Component::IRC’s plugin_add method.

CWgetsockname

Gives access to the underlying listener’s getsockname method. See POE::Wheel::SocketFactory for details.

OUTPUT EVENTS

The plugin generates the following additional POE::Component::IRC events:

CWirc_console_service

Emitted when a listener is successfully spawned. ARG0 is the result of getsockname, see above for details.

CWirc_console_connect

Emitted when a client connects to the console. ARG0 is the peeradr, ARG1 is the peer port and ARG2 is the wheel id of the connection.

CWirc_console_authed

Emitted when a client has successfully provided a valid password. ARG0 is the wheel id of the connection.

CWirc_console_close

Emitted when a client terminates a connection. ARG0 is the wheel id of the connection.

CWirc_console_rw_fail

Emitted when a POE::Wheel::ReadWrite could not be created on a socket. ARG0 is the peer’s address, ARG1 is the peer’s port.

AUTHOR

Chris ’BinGOs’ Williams

SEE ALSO

POE::Component::IRC

POE::Wheel::SocketFactory

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


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

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