A simple TCP-based chat server implemented in C++.
Contributions are welcome! Please follow conventional C/C++ style and document any new functionality with clear comments or test files. This project mostly applies Canoncial Project Structure with minor exceptions.
Please also check our Code of Conduct before contributing.
make buildThis compiles the project with optimization flags into target/chatd.
make build_debugThis compiles with debug symbols (-g3) and assertions enabled into
target/chatd.debug.
| Command | Description |
|---|---|
make run |
Runs the optimized binary. |
make debug |
Runs the debug binary inside gdb. |
make memcheck |
Runs the project with valgrind. |
Unit tests are automatically discovered if files end with .test.c or
.test.cpp.. For C++ tests, append .xx to the Make target name.
For example, if you have a file like chatd/collections/vec.test.c, you can:
- Build it with:
make build_test_colections/vec - Run it under
gdbwith:make test_collections/vec - Run it under
valgrindwith:make memcheck_test_collections/vec
For C++, Make targets are the same but postfixed with .xx. I.e. to run
chatd/collections/vec.test.cpp, use make test_collections/vec.xx.
Note: Test binaries are placed under target/tests.
- GNU Make (v4 or later)
g++,gccbear(optional, forcompile_commands)valgrind(optional, formemleak)gdb(optional, for debugging)
To generate a compile_commands.json file for use in IDEs or language servers:
make compile_commands