This project started as a course assignment for Network Programming but quickly evolved into a full-fledged LAN messaging and file-sharing system — complete with timestamps, file transfer, message logging, and cross-platform support.
My goal was to build a real-time terminal-based chat system that supports multiple users over LAN, allows file sharing, and works seamlessly on both Windows and macOS. The final result is a clean, command-line powered tool that I'm proud to open source.
The application follows a client-server model. The server handles multiple clients using threads. Messages and files sent from any client are received by the server and broadcast to all other clients.
+-----------+ +-------------+ +-----------+
| Client A | <---> | Server | <---> | Client B |
+-----------+ +-------------+ +-----------+
\ /
\--------- File Relay ------------/
Files are broken into chunks and reassembled on the receiving client’s side. A simple protocol using FILE:<filename> and FILE_END markers was used for file transfer.
chatlog.txtreceived/ folder/help, /file, /list, /exitinet_pton() compatibility on Windows (fallback to inet_addr())_mkdir on Windows, mkdir on macOS)FILE_END/help command shows all supported actions.



This project taught me practical low-level networking — from socket creation to file transfer protocols. I learned how to write threaded applications in C++ and how to make code portable across operating systems. Debugging platform-specific issues also helped me better understand system-level development.
You can find the full project source code on GitHub:
https://github.com/harsh4dev/LanChatroomNP
Thanks for reading! I hope this helps anyone curious about building networked C++ applications. Feel free to test it out or fork it — and message me (over LAN or GitHub 😄)!
Your email address will not be published. Required fields are marked *