Lesson 11advancedIPC

TCP Sockets

Network programming with TCP sockets. Covers the full socket lifecycle (socket, bind, listen, accept, read/write, close), multiplexing with select(), and three complete client-server applications: echo, chat, and an arithmetic evaluator.

socketTCPbindlistenacceptselectclient-server
1

Echo Server

A TCP echo server using select() for multiplexing — handles multiple clients and echoes back everything received.

01-example/echo-server.c186 lines
2

Echo Client

A TCP client that connects to the echo server and sends/receives messages.

01-example/echo-client.c129 lines
3

Chat Server

A multi-client chat server — messages from one client are broadcast to all connected clients.

02-chat/chat-server.c182 lines
4

Chat Client

A chat client that connects to the chat server for real-time group messaging.

02-chat/chat-client.c162 lines
5

Arithmetic Server

A TCP server that receives arithmetic expressions, evaluates them, and returns results — a practical client-server application.

03-arithmetic/server.c232 lines
6

Arithmetic Client

Sends arithmetic expressions to the server and displays the computed results.

03-arithmetic/client.c124 lines

Open Full Terminal

Get a Linux terminal with all 6 files from this lesson pre-loaded. Compile, run, and experiment freely.