ConnectionManager Class Reference

This manager deals with the connection. More...

#include <connectionmanager.h>

Inheritance diagram for ConnectionManager:

BaseManager List of all members.

Public Member Functions

 ConnectionManager (KernelMessenger &rKernel, ListeWidget &rWidget)
 Constructor.
virtual ~ConnectionManager ()
 Destructor.
void setConnection (const Contact &contact, const ContactList &list)
 This method marks the end of the connection process.
void connectionEstablished (const bool bResult, const Contact &contact)
 This methods marks the end to the authentification process.
void newConnection (const std::string &username, const std::string &password)
 Start a new connection process.
void contactListReceived (const bool bResult, const ContactList &list)
 This methods is called when the user contact list is received.
void closeConnection ()
 This method closes the connection to the server.
void connectionFailed ()
 This method reports an error during the connection process.
void stopConnectionProcess ()
 This method stops the connection process.
void setSocketStatus (const bool bStatus)
 Private method to change the socket status.
void writeMessage (const BaseMessage &message)
 It write a message in the socket.
void connectToHost (const std::string &hostname, const int port)
 Connects the socket to specified hostname and port.
void close ()
 Close the socket connection.
void setConnectionOptions (const std::string &hostname, const int port)
 Sets the connection parameters.

Static Public Attributes

static const char * DEFAULT_HOST = "localhost"
 Default host used for the connection.
static const int DEFAULT_PORT = 4178
 Default port used for the connection.
static const int TIMEOUT = 50000
 Max connection time.

Friends

class ConnectionProcess

Detailed Description

This manager deals with the connection.

It offers methods such as connecton and deconnection. It also manages errors due to socket.

Author:
Sylvain Archenault <sylvain.archenault@laposte.net>

Yves Houpert <yves.houpert@insa-rouen.fr>


Constructor & Destructor Documentation

ConnectionManager::ConnectionManager KernelMessenger rKernel,
ListeWidget rWidget
 

Constructor.

Parameters:
rKernel KernelMessenger instance.
rWidget ListeWidge object.


Member Function Documentation

void ConnectionManager::connectionEstablished const bool  bResult,
const Contact contact
 

This methods marks the end to the authentification process.

This method is called when the authentification to the server is ended.

Parameters:
bResult Result of the authentificaion.
contact If bResult is true, it's a valid Contact object representing the client.

void ConnectionManager::connectionFailed  ) 
 

This method reports an error during the connection process.

It should be called when an error during the connection is met.

void ConnectionManager::connectToHost const std::string &  hostname,
const int  port
 

Connects the socket to specified hostname and port.

Parameters:
hostname Hostname the server is hosted.
port Port the server is listening.

void ConnectionManager::contactListReceived const bool  bResult,
const ContactList list
 

This methods is called when the user contact list is received.

Parameters:
bResult Result of the request.
list If bResult is true, it's a valid ContactList object composed by the user's contact.

void ConnectionManager::newConnection const std::string &  username,
const std::string &  password
 

Start a new connection process.

Parameters:
username Username to use for the authentification.
password Password to use for the authentification.

void ConnectionManager::setConnection const Contact contact,
const ContactList list
 

This method marks the end of the connection process.

It's called when the connection, the authentification and the contact list reception are done.

Parameters:
contact Contact object representing the user (client).
list Contact list of the user (client).

void ConnectionManager::setConnectionOptions const std::string &  hostname,
const int  port
 

Sets the connection parameters.

Parameters:
hostname Hostname where the server resides.
port Port to use for the connection.

void ConnectionManager::setSocketStatus const bool  bStatus  ) 
 

Private method to change the socket status.

Parameters:
bStatus Socket status ; true means the socket is connected, false disconnected.

void ConnectionManager::writeMessage const BaseMessage message  ) 
 

It write a message in the socket.

Parameters:
message Message to write.


The documentation for this class was generated from the following files:
Generated on Fri May 19 12:15:55 2006 for Bamboo Ch@t by  doxygen 1.4.6