SourceForge Logo

NAME

Boucherot::Connection::Irc - An IRC Connection for boucherot

SYNOPSIS

  use Boucherot::SetOfConnections;
  use Boucherot::Connection::Irc;
  $soc=new Boucherot::SetOfConnections;
  $irc=new Boucherot::Connection::Irc(
    $soc,
    'server' => 'gissehel.jcl',
    'nicks' => [ '}Leriel{', '}Arael{', '}Sandalphon{', '}Tablis{' ],
    'username' => 'angel',
    'ircname' => 'A cruel Angel that has no sense of mercery',
  );

DESCRIPTION

This class is a subset of Boucherot

This class inherot from Boucherot::Connection and is specialized to handle an irc connection. An irc connection can login, auto-reconnect, and analyse what received.

Most of the actions are done elsewhere, in non-object code, because one of the goals of boucherot was to allow the use of xchat scripts.

But there are too much non-object code I think.

GISSUML MODEL

class Boucherot::Connection::Irc

Attributs:

 +  nick : SCALAR
 +  username : SCALAR
 +  userarg : SCALAR
 +  ircname : SCALAR
 +  maxlinelen : SCALAR
 +  nicks : Array
 +  servers : Array
 +  channels : Boucherot::Channels
 +  ping : SCALAR
 +  handler : Boucherot::Handler
 -  socketId : SCALAR 
 -  already_in_reconnection : BOOLEAN

Methods:
 +$ new ( parent, ... ) : Boucherot::Connection::Irc
 +  init_instance ( ... ) : 
 +  id () : SCALAR
 +  removable () : Boolean
 +  parse_line ( line ) : 
 +  login ( 'ircname' => ircname, 'username' => username, 'nicks' => Array ) :
 +  rawsend ( line ) :
 #  on_connected () : 
 #  on_disconnected () :
 -  reconnect_timeout () :
 -  ping_start ( socketId : SCALAR ) :

new

 +$ new ( parent, ... ) : Boucherot::Connection::Irc

Create a new instance of Boucherot::Connection::Irc

init_instance

 +  init_instance ( ... ) :

init_instance is called each time a connection is created.

It's auto-called between the connnection is created and the socket is opened.

id

 +  id () : SCALAR

This method is for idententifying the Irc connection by a unique way.

It's the server name.

removable

 +  removable () : Boolean

Return true if the connection should be remove once it has been closed.

Here the result is false. An irc connection SHOULD reconnect. The deconnection is explicitly asked.

parse_line

 +  parse_line ( line ) :

That method is called each time a line is received from Irc.

logininfo

 +  logininfo ( 'ircname' => ircname, 'username' => username, 'nicks' => Array ) :

Login into irc with using arguments if there are specified. If not, using internal attributs (for reconnection for exemple...).

login

 +  login () :

Login into irc.

rawsend

 +  rawsend ( line ) :

send a raw line to the Irc server. Just log the line...

on_connected

 #  on_connected () :

Called on each socket disconnected.

on_disconnected

 #  on_disconnected () :

Called on each socket disconnected. Here, the socket IS already closed. The socket may have been closed by the other side or by this side.

reconnect_timeout

 -  reconnect_timeout () :

Try to reconnect if not connected.

ping_start

 -  ping_start ( socketId : SCALAR ) :

Start a ping, and reschedule a new ping_start or disconnect.

(Note that disconnect call reconnect, that call login, that reschedule a new ping_start).

AUTHORS

This class was written by Arthibus Gissehel <gissehel@vachefolle.com> in 2000.

NOTES

This class is part of the Boucherot project.