Skip to content

A simple multi-threaded chat server and client system built in C++ using Winsock. The server handles multiple clients over TCP and broadcasts messages in real-time. Great for learning socket programming and multithreading on Windows.

Notifications You must be signed in to change notification settings

superdudeneel/HandshakesAndBytes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฌ Multi-Client Chat Server in C++ using Winsock

This project implements a basic multi-threaded chat server and clients using Winsock (Windows Sockets API) in C++. The server listens for incoming TCP connections and broadcasts messages between connected clients.


๐Ÿ“ Files

  • server.cpp - The server that accepts multiple clients and relays their messages.
  • client1.cpp - A simple chat client that can send and receive messages.
  • client2.cpp - Identical to client1.cpp (can simulate another user for testing).

โš™๏ธ Requirements

  • Windows OS
  • g++ from MinGW (or use Visual Studio)
  • Winsock2 library (already included with Windows SDK)

๐Ÿ› ๏ธ How to Compile

Using MinGW (MSYS2 or Command Prompt):

Compile Server

g++ server.cpp -o server.exe -lws2_32
g++ client1.cpp -o client1.exe -lws2_32
g++ client2.cpp -o client2.exe -lws2_32
./server.exe
./client1.exe
./client2.exe

About

A simple multi-threaded chat server and client system built in C++ using Winsock. The server handles multiple clients over TCP and broadcasts messages in real-time. Great for learning socket programming and multithreading on Windows.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages