Protocol

Chatter-jee Client and Server follow a strict protocol to communicate effectively. For this protocol, it uses an Object called Message Packet. The design of Message Packet is exactly the same at both client and server end, and both agree on certain terms of contract about what each message means.

Chatter-jee Client and Server send data to each other by making use of Message Packet only. The data is transmitted across the network using TCP/IP Stream Sockets.

Along with other relevent data, the client and server send a Reason Flag in each message. Depending on this Reason Flag, the receiver of the message decides its next action. So following a strict protocol for sending the correct Reason Flag is very important in this application.

Reason flags are nothing but MFC CString objects. Below is given the list of various Reason Flags:

From Client to Server

Reason Flag Meaning
L Login Request
R Registration Request
M Sending Message to Other User
SL Logged in. Send me Friend's list
SLO Logged in and Got Friend's list. Now send me Offline Messages
ON Send me the Next Offline Message
X Logoff Request
AF Trying to Add a Friend
AFA Added Friend has given permission to be added, and also added the requester as his friend
AFJ Added Friend has given permission to be added, but hasn't added the requester as his friend
AFD Added Friend has refused permission to be added
C Change Password Request
DF Delete Friend(s) Request
BUP Block a User Permanently
BU Block a User as long as I am logged in
BUL Send me the list of users Blocked by me
BUR Remove some User ids from my Blocked users list

From Server to Client

Reason Flag Meaning
Z Server is Shutting Down
ZX Administrator has logged you off
SL Login is successful
SLU Logged in complete at server end and received Friend's list
SR Registration request successful
SM Got a message from another user
SN Some other user has come online
SX Some other user has gone offline
SFA Someone wants to add you as a friend and has sent a message for it.
SFN Someone has accepted your request to be added as a friend, and is presently online
SFX Someone has accepted your request to be added as a friend, but is presently offline
SC Password change is successful
SD Removal of chosen user ids from your friends list is successful
SB Removal of chosen user ids from your blocked users list is successful
SO An offline message received
SOL Last offline message received
SB Blocked users list is received
F* Any kind of failure