BEVERLYQIN

Back to Projects

Networked Chat Client-Server Application

my role

Developer

year

2025

contribution

Development, Testing

tools

C, Network Programming

team

Sanjay Kumar

Project Details

Developed a command-line chat client in C that communicates with a server over TCP sockets. The client supports real-time message broadcasting, allowing multiple clients to exchange messages through a central server.

Note: Course assignment – full code not public, available upon request.

Key Features

Socket Connections

• Created and managed TCP sockets, handling both connection setup and graceful shutdowns

User Management

• Implemented username validation with length limits and server-side handshake

Message Handling

• Sent and received messages via send_with_length and recv_with_length protocols, ensuring null-terminated string handling

Event Loop

• Used fd_set and select() to multiplex input from both stdin and the network socket, enabling simultaneous user input and server message reception

Error Handling

• Robust checks for invalid IPs, ports, and failed system calls, with clear error reporting

Session Control

• Supported commands like bye to exit gracefully, along with detecting server disconnects or crashes