This repository contains the solutions to Exercise 3 from the Computer Networks course, implemented in C.
The project is divided into two parts:
- Part A – Socket programming and basic server implementation
- Part B – Concurrent networking and threaded client‑server interaction
- Socket programming (TCP/UDP)
- Client/server communication
- Multi‑client handling
- Concurrency with threads
- Message passing between networked processes
Part A/ # Socket server and networking code Part B/ # Threaded networking and concurrent communication
- C — primary language
- BSD sockets API for network communication
- pthread (POSIX threads) for concurrency
- Compilable with a standard GCC toolchain
cd "Part A"
gcc -o server server.c # adjust filenames if needed
./servercd "Part B"
gcc -o client client.c server.c -lpthread # example
./serverNote: Each part may include multiple C source files. Use a Makefile or gcc directly.
For Part A:
./serverFor Part B:
./server
./clientFollow the on‑screen instructions and input formats.
This project demonstrates:
- Low‑level socket I/O in C
- Communication protocols
- Handling multiple clients
- Concurrency and thread synchronization