Chatter-jee Server Data Structures

Chatter-jee server maintains Several Data Structures during its lifetime. Their list is given below. All these data structures are in a form of Pointers list.

Data Structure What it stores
m_ClientsList List of all client sockets where the clients have logged in. Each element in this list points to a Client Socket.
m_SocketsList List of all client sockets where the clients have not logged in, but just connected. Each element in this list points to a Client Socket.
m_OfflineMessagesList List of all offline messages for all clients, who haven't logged in yet. Each element in this list points to a Message Packet.
m_BlockedUsersList List of all users who have blocked other users. Each element in this list points to a message packet.

Chatter-jee Server also maintains some other data as follows:

Variable Name What it stores
m_nPortNum Port on which the server socket is to be opened. (Read from Config.txt file)
m_pServerSocket The one and only Server Socket where connections are accepted.
m_pClientSocket This var will be used again and again for spawning Client Sockets, when connection requests are received from clients.
m_hSocketsListMutex Used as a 'lock' on m_SocketsList, for avoiding thread conflicts in modifying it.
m_hClientsListMutex Used as a 'lock' on m_ClientsList, for avoiding thread conflicts in modifying it.
m_hOfflineMessagesListMutex Used as a 'lock' on m_OfflineMessagesList, for avoiding thread conflicts in modifying it.
m_hBlockedUsersListMutex Used as a 'lock' on m_BlockedUsersList, for avoiding thread conflicts in modifying it.