https://github.com/bl33h/clientserverchat
A program that enables multi-client communication through a central server, using socket programming and threads for concurrent connections.
https://github.com/bl33h/clientserverchat
chat client-server client-server-architecture client-server-chat-application protobuf pthreads thread threads
Last synced: 9 months ago
JSON representation
A program that enables multi-client communication through a central server, using socket programming and threads for concurrent connections.
- Host: GitHub
- URL: https://github.com/bl33h/clientserverchat
- Owner: bl33h
- License: mit
- Created: 2024-03-13T21:50:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T04:34:52.000Z (over 1 year ago)
- Last Synced: 2025-01-21T15:15:26.343Z (11 months ago)
- Topics: chat, client-server, client-server-architecture, client-server-chat-application, protobuf, pthreads, thread, threads
- Language: C
- Homepage:
- Size: 84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clientServerChat
This is a chat application that facilitates communication between multiple clients through a centralized server. The application is designed using socket programming and handles multiple client connections concurrently using threads.
Files •
Features •
How To Use •
Contributions
## Files
- `client.c`: Implements the client-side of the chat application.
- `server.c`: Implements the server-side of the chat application, managing multiple client connections.
- `chat.pb-c.c`, `chat.pb-c.h`: Provide protobuf-c functionality for structured message communication between clients and server.
## Features
- **Multi-client Support**: The server can handle multiple client connections simultaneously.
- **Threaded Communication**: Utilizes threads to manage client connections and maintain server responsiveness.
- **Protobuf Communication**: Uses protobuf for structured and efficient data serialization.
- **Dynamic User Interaction**: Supports real-time messaging, user status updates, and connection management.
- **Robust Error Handling**: Implements error checking and handling to ensure reliable operation.
## How To Use
To clone and run this application, you'll need [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install) and the following tools installed on it: [Git](https://git-scm.com), [C compiler](https://gcc.gnu.org), and [POSIX threads](https://www.cs.cmu.edu/afs/cs/academic/class/15492-f07/www/pthreads.html). From your command line:
```bash
# Clone this repository
$ git clone https://github.com/bl33h/clientServerChat
# Open the project
$ cd src
# Compile the server and client
$ gcc -o server server.c chat.pb-c.c -lprotobuf-c -pthread
$ gcc -o client client.c chat.pb-c.c -lprotobuf-c -pthread
# Start the server (specify the port number)
$ ./server 12345
# In a new terminal, start a client
$ ./client 127.0.0.1 12345