Skip to content

SSwapnild31/chat-system-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Client-Server Chat Application

A real-time client-server chat application built using C and TCP socket programming. The application enables a client to connect to a server and exchange messages reliably over a network.

πŸš€ Features

  • πŸ’¬ Real-time bidirectional communication
  • ⚑ Concurrent client handling using pthreads
  • πŸ”’ Reliable data transmission over TCP/IP
  • ⚠️ Error handling and graceful client disconnection
  • πŸ–₯️ Runs on Linux (Ubuntu)

πŸ› οΈ Technologies Used

  • C (Socket Programming)
  • TCP/IP Protocol
  • POSIX Threads (pthreads)
  • GCC (Compilation)
  • GDB (Debugging)
  • Linux (Ubuntu)

πŸ“¦ Installation

  • Clone the repository:

     git clone https://github.com/SSwapnild31/chat-system-project.git
  • change directory to chat-system-project

    cd chat-system-project
  • Compile and create exe file called server

     cc server.c -o server
  • Run the exe file with port number and ip address(127.0.0.1) - any ip & port no

     ./server 2000 127.0.0.1
  • Compile and create exe file called client

     cc client.c -o client
  • Run the exe file with port number and ip address same as server

  • In different terminal

     ./client 2000 127.0.0.1

βš™οΈ How It Works

  • Server creates a socket(), binds() to a port, and listen() for incoming connections
  • Multiple clients connect using TCP sockets
  • Server uses pthreads to handle multiple clients concurrently as well as send/receive messages at same time
  • Messages are sent and received using send() and recv() system calls

🧠 Learnings

  • Hands-on experience with TCP socket programming
  • Understanding of client-server architecture
  • Thread management using pthreads
  • Working with Linux system calls
  • Debugging using GDB

πŸ“Œ Future Improvements

  • Add private messaging between clients
  • Implement authentication system
  • Use select() or poll() for I/O multiplexing
  • Add logging and message history
  • Improve scalability using epoll (Linux)

πŸ“Έ Screenshots/Output

  • Server

  • Client

🀝 Contributing

  • Feel free to fork and improve the project!

πŸ“„ License

  • This project is for learning purposes.

About

client-server-chat-application

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages