The following repository consists of a chat-client application. The server is provided by the Vrije Universiteit Amsterdam.
The chat client must meet the following requirements:
- Connect to the chat server and log in using a unique name.
- Ask for another name is the chosen name is already taken.
- Shutdown the client by typing !quit.
- List all currently logged-in users by typing !who.
- Send messages to other users by typing @username message.
- Receive messages from other users and display them to the user.
Message | Sent by | Description |
---|---|---|
HELLO-FROM \n | Client | First hand-shake message. |
HELLO \n | Server | Second hand-shake message. |
WHO\n | Client | Request for all currently logged-in users. |
WHO-OK ,...,\n | Server | A list containing all currently logged-in users. |
SEND \n | Client | A chat message for a user. Note that the message cannot containthe newline character, because it is used as the message delimiter. |
SEND-OK\n | Server | Response to a client if their βSENDβ message is processedsuccessfully. |
UNKNOWN\n | Server | Sent in response to a SEND message to indicate that thedestination user is not currently logged in. |
DELIVERY \n | Server | A chat messagefroma user. |
IN-USE\n | Server | Sent during handshake if the user cannot log in because thechosen username is already in use. |
BUSY\n | Server | Sent during handshake if the user cannot log in because themaximum number of clients has been reached. |
BAD-RQST-HDR\n | Server | Sent if the last message received from the client contains an errorin the header. |
BAD-RQST-BODY\n | Server | sent if the last message received from the client contains an errorin the body. |
Table 1: Chat Application Protocol. Angular brackets (<>) indicate variable content.