Loading
Loading
University exercises exploring TCP, UDP, and Unix-domain sockets in C, alongside a basic TCP port scanner.
In this case study
I made this collection in 2019 while learning network programming at university. Small client-server programs explore how processes communicate through Internet and Unix-domain sockets, using both streams and datagrams.
Understand the socket lifecycle directly in C: create an endpoint, bind an address, establish a connection where needed, and exchange data between processes.
Separate client and server examples cover IPv4 TCP and UDP, plus Unix-domain stream and datagram sockets. The TCP example exchanges console messages; the UDP example sends a greeting. Local socket examples use filesystem paths for communication on the same machine. A separate scanner attempts TCP connections across a supplied port range.
Each example runs as separate client and server processes using the operating system's socket API. Internet sockets use IPv4 addresses and ports, while Unix-domain sockets use local paths. Stream servers use bind, listen, and accept before exchanging data. Datagram examples send or receive messages without that connection-acceptance step. The scanner makes sequential TCP connection attempts.
These are learning exercises with limited validation and error handling. They do not provide production-ready connection management or robust handling of partial reads and writes. The scanner has no explicit connection timeout, does not check hostname-resolution failure, and reports failed connections as closed ports even when other causes are possible.