ircproxy  The Ultimate Cyborg

ServerSessionInput Class Reference

#include <ServerSessionInput.h>

Inheritance diagram for ServerSessionInput:

List of all members.


Detailed Description

Server session input decoder.

This class is responsible for decoding messages received from a server.

Definition at line 30 of file ServerSessionInput.h.


Public Member Functions

 ServerSessionInput (input_buffer_ct *ibuf)
 Constructor (see libcw).

Protected Member Functions

void decode (msg_block_ct msg_block)
 Decode message msg_block as received from server.

Private Attributes

ServerMessageIn M_current_msg
 The IRC message currently being decoded.

Constructor & Destructor Documentation

ServerSessionInput::ServerSessionInput ( input_buffer_ct *  ibuf  ) 

Constructor (see libcw).

Definition at line 29 of file ServerSessionInput.cc.

00029                                                             : read_input_tct<text>(ibuf), M_current_msg(static_cast<ServerSession*>(this))
00030 {
00031 }


Member Function Documentation

void ServerSessionInput::decode ( msg_block_ct  msg_block  )  [protected]

Decode message msg_block as received from server.

This function is called when a new, complete IRC message has been received from the IRC server connected to the associated socket.

Definition at line 38 of file ServerSessionInput.cc.

References DoutEntering, MessageIn::init(), M_current_msg, and debug::channels::dc::serverinput.

00039 {
00040 #ifdef CWDEBUG
00041   // Suppress PING related messages if requested.
00042   bool is_ping = (msg_block.get_size() >= 5 && strncmp(msg_block.get_start(), "PING ", 5) == 0 && Application::instance().suppress_ping());
00043   Debug(if (is_ping) libcw_do.off());
00044 
00045   // Set the global variable debug::secondary_connection, if needed.
00046   debug::SecondaryConnection dummy(dynamic_cast<ServerSession*>(this)->server_connection().secondary_connection());
00047 #endif
00048 
00049   DoutEntering(dc::serverinput, "ServerSessionInput::decode(\"" << buf2str(msg_block.get_start(), msg_block.get_size()) << "\")");
00050 
00051   // Initialize M_current_msg for decoding purposes.
00052   M_current_msg.init(msg_block);
00053 
00054   // Pass it on.
00055   new_message_received(M_current_msg);
00056 
00057   // Turn debugging on again if needed.
00058   Debug(if (is_ping) libcwd::libcw_do.on());
00059 }


Member Data Documentation

The IRC message currently being decoded.

Definition at line 32 of file ServerSessionInput.h.

Referenced by decode().


The documentation for this class was generated from the following files:

Copyright © 2005-2007 Carlo Wood.  All rights reserved.