Client application for communicating with a chat server using a custom IPK25-CHAT protocol. The project implements the TCP variant of the protocol, handling connection setup, authentication, joining channels, sending and receiving messages, and graceful termination. The design anticipates extension to the UDP variant. The implementation uses object-oriented design and state/strategy design patterns.
Technical Documentation is in form of markdown in doc/ directory.
- Linux (or WSL/Unix-like environment)
- g++ (with C++20 support)
- make
- Clone the repository
git clone git@github.com:petr-plihal/chat-client-ipk25.git
cd chat-client-ipk25- Build the project
makeNOTE: The Makefile is set to compile the program without -DDEBUG_PRINT flag. The flag can be added, in case you want to know how the program roughly operates. To turn this on, simply add the -DDEBUG_PRINT to the flags in Makefile on line 5.
If no server is setup for connection, you can run simple dummy python server script, or use the nc command to simulate chat server. All the Python server does is respond to your messages and commands with acknowledgements. Plus it repeats any messages sent.
First run the server in one terminal:
python3 ./test/simple_server.pyIn another terminal, run application with:
./ipk25chat-client -t tcp -s 127.0.0.1NOTE: To see what the arguments mean, you can see help:
./ipk25chat-client -hIn the client application, to see what commands are available for interaction with the program, type /help.
The general user-flow might be as follows:
- Authenticate with the server using username, secret, display name.
/auth username secret display_name- Join different channels (by default you are joined into general channel).
/join different_channel- Send message into current channel.
Simply write the message without any "\", the server will just send it back.- To correctly terminate the connection, use
CTRL+C, the server will shut down too.
Alternatively, you can use nc command to receive client messages as text, and respond by manually typing the responses. To start listening:
nc -4 -C -l -p 4567See the assignment or documentation for more usage examples.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.