Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

IpcType Class Reference

The master IPC class. More...

#include <sipc.h>

List of all members.

Public Member Functions

int start (int portNum)
 Start up an IPC listener.

void fdFillSet (fd_set &)
 Place all descriptors that need to be polled in a fd select() set.

int getListenfd ()
int getTopfd ()
void pollAndHandle (fd_set &read, fd_set &write, fd_set &except)
 Handle the results of a select() or poll().

void freeCon (IpcConnectType *)
 Free out a connection object.

void addCon (IpcConnectType *)
 Add a logical connection item to the 'links' listing.

void delCon (IpcConnectType *)
 Remove a connection item from the 'links' listing.


Private Member Functions

int ReadPackets (IpcConnectType *)
 Read packets from a connection and buffer them for processing.

void authMessage (IpcConnectType *, parse_t *)
 Handle an authentication message.

void authSysMessage (IpcConnectType *, parse_t *)
 Handle AUTH SYSTEM.

void authObjMessage (IpcConnectType *, parse_t *)
 Handle AUTH OBJECT.

void queryMessage (IpcConnectType *, parse_t *)
 Handle a query message.

void querySysMessage (IpcConnectType *, parse_t *)
 Handle QUERY SYSTEM.

void queryObjMessage (IpcConnectType *, parse_t *)
 Handle QUERY OBJECT.

int queryRegNickMessage (RegNickList *, const char *, IpcConnectType *, parse_t *)
 Handle QUERY OBJECT RNICK.

void makeMessage (IpcConnectType *, parse_t *)
 Handle MAKE OBJECT.

void alterMessage (IpcConnectType *, parse_t *)
 Handle an alter message.

void logMessage (IpcConnectType *, parse_t *)
 Handle a log message.

void alterObjMessage (IpcConnectType *, parse_t *)
 Handle ALTER OBJECT.

int alterRegNickMessage (RegNickList *, const char *, IpcConnectType *, parse_t *)
 Handle ALTER OBJECT RNICK.


Private Attributes

int listenDesc
 Descriptor of listener.

int topFd
 Highest fd of this IPC unit.

IpcConnectType * links
 Connected clients.


Detailed Description

The master IPC class.

Manages IPC listeners and connections

Definition at line 261 of file sipc.h.


Member Function Documentation

void IpcType::addCon (  IpcConnectType *  p  ) 
 

Add a logical connection item to the 'links' listing.

Parameters:
p Pointer to connection object to add

Definition at line 653 of file sipc.cc.

References links, and IpcConnectType::next.

Referenced by pollAndHandle().

void IpcType::delCon (  IpcConnectType *  zap  ) 
 

Remove a connection item from the 'links' listing.

Parameters:
zap Item to remove

Definition at line 664 of file sipc.cc.

References IpcConnectType::fd, links, listenDesc, IpcConnectType::next, and topFd.

Referenced by pollAndHandle().

void IpcType::fdFillSet (  fd_set &  fset  ) 
 

Place all descriptors that need to be polled in a fd select() set.

Parameters:
fset Set of descriptors to place in the set

Definition at line 631 of file sipc.cc.

References IpcConnectType::fd, links, listenDesc, and IpcConnectType::next.

Referenced by main().

void IpcType::pollAndHandle (  fd_set &  readme,
fd_set &  writeme,
fd_set &  xcept
) 
 

Handle the results of a select() or poll().

Parameters:
readme Read descriptor set from select()
writeme Write descriptor set from select()
xcept Except descriptor set from select()
Given the 3 descriptor sets from the select set, handle the I/O as needed (process incoming data, write out data, etc)

Definition at line 775 of file sipc.cc.

References addCon(), IpcConnectType::addr, alterMessage(), authMessage(), IpcConnectType::buf, delCon(), doNonBlock(), IpcConnectType::fd, freeCon(), IpcConnectType::fWriteLn(), links, listenDesc, logMessage(), makeMessage(), myname, IpcConnectType::next, oalloc(), IpcConnectType::objType, parse_getarg(), IpcConnectType::pass, IpcQ::pop(), queryMessage(), ReadPackets(), IpcConnectType::s, IpcConnectType::sWrite(), topFd, and IpcConnectType::user.

Referenced by main().

int IpcType::ReadPackets (  IpcConnectType *  ptrLink  )  [private]
 

Read packets from a connection and buffer them for processing.

Parameters:
ptrLink Pointer to the connection endpoint
Returns:
-1 if the connection is closing, 0 on no data yet or data read

Definition at line 720 of file sipc.cc.

References IpcConnectType::buf, IpcConnectType::fd, IpcQ::shove(), and strncpyzt.

Referenced by pollAndHandle().

int IpcType::start (  int  portNum  ) 
 

Start up an IPC listener.

Parameters:
portNum Number of port to listen on
Returns:
-1 on failure, 0 on success

Definition at line 585 of file sipc.cc.

References doNonBlock(), listenDesc, and topFd.

Referenced by main().


The documentation for this class was generated from the following files:
Generated at Sat Oct 25 20:56:13 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.