Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OCopServer Class Reference

#include </home/clem/local/src/opie/x11/ipc/server/ocopserver.h>

Collaboration diagram for OCopServer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OCopServer ()
 ~OCopServer ()
QStringList channels ()
bool isChannelRegistered (const QCString &) const

Private Slots

void errorOnServer ()
void newOnServer ()
void newOnClient (int fd)
void initSocket ()

Private Member Functions

void addChannel (const QCString &channel, int fd)
void delChannel (const QCString &channel, int fd)
void deregisterClient (int fd)
void registerClient (int fd)
void init ()
int accept ()
void isRegistered (const QCString &channel, int)
void dispatch (const OCOPPacket &, int sourceFD)
void call (const OCOPPacket &, int sourceFD)
QValueList< int > clients (const QCString &channel)

Private Attributes

QMap< int, OCOPClientm_clients
QMap< QCString, QValueList<
int > > 
m_channels
QSocketNotifier * m_server
QSocketNotifier * m_serverError
int m_serverfd
sockaddr_un m_address
unsigned int m_adrlaenge

Detailed Description

This is the main server It starts the socket takes care of the receiving and sending

Definition at line 20 of file ocopserver.h.


Constructor & Destructor Documentation

OCopServer::OCopServer  ) 
 

Definition at line 14 of file ocopserver.cpp.

References init(), and initSocket().

OCopServer::~OCopServer  ) 
 

Definition at line 25 of file ocopserver.cpp.

References m_serverfd.


Member Function Documentation

int OCopServer::accept  )  [private]
 

Definition at line 129 of file ocopserver.cpp.

References m_address, m_adrlaenge, and m_serverfd.

Referenced by newOnServer().

void OCopServer::addChannel const QCString channel,
int  fd
[private]
 

add a channel with a fd if the channel is not present then it'll be created if it's present we will ad the fd

Definition at line 328 of file ocopserver.cpp.

References QValueList< T >::append(), QValueList< T >::count(), QMap< Key, T >::end(), QMap< Key, T >::find(), QMap< Key, T >::insert(), list, m_channels, qWarning(), and QMap< Key, T >::replace().

Referenced by dispatch().

void OCopServer::call const OCOPPacket ,
int  sourceFD
[private]
 

Definition at line 400 of file ocopserver.cpp.

References QValueList< T >::begin(), OCOPPacket::channel(), clients(), OCOPPacket::content(), QValueList< T >::end(), OCOPPacket::head(), OCOPPacket::header(), and write().

Referenced by dispatch().

QStringList OCopServer::channels  ) 
 

Definition at line 315 of file ocopserver.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::end(), list, and m_channels.

QValueList< int > OCopServer::clients const QCString channel  )  [private]
 

Definition at line 397 of file ocopserver.cpp.

References m_channels.

Referenced by call().

void OCopServer::delChannel const QCString channel,
int  fd
[private]
 

Definition at line 344 of file ocopserver.cpp.

References QMap< Key, T >::contains(), QValueList< T >::count(), QValueList< T >::find(), QMap< Key, T >::find(), m_channels, rem, QValueList< T >::remove(), QMap< Key, T >::remove(), QMap< Key, T >::replace(), and str.

Referenced by dispatch().

void OCopServer::deregisterClient int  fd  )  [private]
 

fd was closed

Definition at line 214 of file ocopserver.cpp.

References QMap< Key, T >::begin(), QValueList< T >::count(), QMap< Key, T >::end(), QValueList< T >::find(), QMap< Key, T >::find(), m_channels, m_clients, OCOPClient::notify, qWarning(), QValueList< T >::remove(), QMap< Key, T >::remove(), and QMap< Key, T >::replace().

Referenced by dispatch(), and newOnClient().

void OCopServer::dispatch const OCOPPacket packet,
int  sourceFD
[private]
 

this function will evaluate the package and then do the appropriate thins

Definition at line 272 of file ocopserver.cpp.

References addChannel(), call(), OCOPPacket::Call, OCOPPacket::channel(), delChannel(), deregisterClient(), isRegistered(), OCOPPacket::IsRegistered, OCOPPacket::Method, OCOPPacket::Register, OCOPPacket::RegisterChannel, registerClient(), OCOPPacket::Reply, OCOPPacket::Return, OCOPPacket::Signal, OCOPPacket::type(), OCOPPacket::Unregister, and OCOPPacket::UnregisterChannel.

Referenced by newOnClient().

void OCopServer::errorOnServer  )  [private, slot]
 

Definition at line 308 of file ocopserver.cpp.

Referenced by initSocket().

void OCopServer::init  )  [private]
 

Definition at line 29 of file ocopserver.cpp.

References l, m_server, and m_serverError.

Referenced by OCopServer().

void OCopServer::initSocket  )  [private, slot]
 

here we will init our server socket and bind and do the listen

Definition at line 48 of file ocopserver.cpp.

References errorOnServer(), m_adrlaenge, m_server, m_serverError, m_serverfd, newOnServer(), and qWarning().

Referenced by OCopServer().

bool OCopServer::isChannelRegistered const QCString  )  const
 

Definition at line 325 of file ocopserver.cpp.

References QMap< Key, T >::contains(), and m_channels.

Referenced by isRegistered().

void OCopServer::isRegistered const QCString channel,
int  fd
[private]
 

write the head and then channel success/failure inside func

Definition at line 367 of file ocopserver.cpp.

References isChannelRegistered(), OCOPPacket::IsRegistered, and write().

Referenced by dispatch().

void OCopServer::newOnClient int  fd  )  [private, slot]
 

Definition at line 136 of file ocopserver.cpp.

References channel, data, deregisterClient(), dispatch(), and s.

Referenced by registerClient().

void OCopServer::newOnServer  )  [private, slot]
 

we got the possibility to read on the server this is mostly due a connect on a client side we will accept it add it to our list

Definition at line 112 of file ocopserver.cpp.

References accept(), and registerClient().

Referenced by initSocket().

void OCopServer::registerClient int  fd  )  [private]
 

fd popped up

Definition at line 201 of file ocopserver.cpp.

References QMap< Key, T >::contains(), OCOPClient::fd, QMap< Key, T >::insert(), m_clients, newOnClient(), and OCOPClient::notify.

Referenced by dispatch(), and newOnServer().


Member Data Documentation

struct sockaddr_un OCopServer::m_address [private]
 

Definition at line 91 of file ocopserver.h.

Referenced by accept().

unsigned int OCopServer::m_adrlaenge [private]
 

Definition at line 92 of file ocopserver.h.

Referenced by accept(), and initSocket().

QMap<QCString, QValueList<int> > OCopServer::m_channels [private]
 

Definition at line 78 of file ocopserver.h.

Referenced by addChannel(), channels(), clients(), delChannel(), deregisterClient(), and isChannelRegistered().

QMap<int, OCOPClient> OCopServer::m_clients [private]
 

Definition at line 73 of file ocopserver.h.

Referenced by deregisterClient(), and registerClient().

QSocketNotifier* OCopServer::m_server [private]
 

Definition at line 84 of file ocopserver.h.

Referenced by init(), and initSocket().

QSocketNotifier* OCopServer::m_serverError [private]
 

Definition at line 89 of file ocopserver.h.

Referenced by init(), and initSocket().

int OCopServer::m_serverfd [private]
 

Definition at line 90 of file ocopserver.h.

Referenced by accept(), initSocket(), and ~OCopServer().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:42:13 2005 for OPIE by  doxygen 1.4.2