← back

project

Socket-Based Chat Application

CSecure ProgrammingSQLiteServer–Client

A socket-based client–server chat application built in C, where all client interactions are driven by structured commands such as /register, /login, /users, and private messaging.

User credentials and session data are persisted server-side in a lightweight database, with all queries parameterized to guard against SQL injection attacks. The server enforces constraints like registration conflicts, duplicate session prevention, and authentication validation.

Each client request is parsed against a strict command schema — commands with invalid syntax, unknown names, or mismatched context are caught and returned with specific, predefined error messages.

The server's response layer is built around a consistent message contract, making client state management deterministic and the overall system straightforward to debug, test against, and extend.