A real-time TCP chat application
Warning
This is a toy project I made to learn application programming in C and such, is only intended to use for learning and integration test purposes
- gcc, or any C compiler
- POSIX-compliant operating system
- Makefile (optional but recommended)
git clone https://github.com/jakubmartenekdev/inet-chat.git
cd inet-chat/
make all DEBUG=0
sudo make install DEBUG=0 # Optional, avoid typing full path ./build/debug/bin/<prog>
git clone https://github.com/jakubmartenekdev/inet-chat.git
cd inet-chat/
./build.sh
Note
Type "localhost" for <server-addr> if you're testing this on a local machine
server <port>
client <server-addr> <port> [OPTIONS]
| Option | Description |
|---|---|
-h short for --help |
display help message |
-n short for --name |
set up username to be displayed before the message |
- Tcp client with simple TUI
- Tcp server that broadcasts messages
- Uses threadpool
- IPv4 support
- IPv6 support
- UNIX sockets support
- Makefile
- Build script
- Criterion - testing framework
- Unit tests
- Integrated tests
- Many memory leaks
- Fixed a bug where the server wouldn't notify clients after shutdown, leaving clients hanging indefinitely or causing unexpected behavior
- Add more debug logs, especially on server
- Build script to further automate building process
- User nickname is displayed before the message
- Notify client after the server is shut down
- Automatic scroll at the end of area buffer
- I changed append buffer to behave slightly differently, it stores char** instead od char* which is basically what vector does, this allows me to have a better control of how I want to render the screen
- Usage messages
- Many network programs send and receive buffers suffixed with newline character and without null terminator, so I fixed the code to satisfy this "convention?", anyway, client has better support with third party software like tcpbin, which I tested and it works fine
- More descriptive usage messages
- Add metadata to messages
- Fixed bug where sent text appeard inline because of incorrect use of a new line character
- make install && make uninstall
- Add scroll in the client tui, when the buffer reaches the end of window, scroll automatically
- Server uses thread pool instead of processes to handle client requests
- Criterion testing framework, controlled with Makefile
- Common header files for ll_queue.c and client.c
- Refactored Makefile, made use of built in functions like wildcard, patsubst and filter-out
- Changed project structure, including added sub-directories for binaries
- Append buffer now stores an initial capacity, making it more effective by doubling the size when it's full and limits calls to realloc
- Apparently there's a bug, when I append too many messages, program crashes
- Makefile
- Implement a thread pool
- Message broadcasting
- Socket reads are now non blocking
[ ] Client socket should be in shared memory for proper cleanup- Let have more than 5 connections per server runtime
- Initial release
- Socket API
- Hostname to address translation
- N/A
- N/A