C & Unix

select and Multiplexed I/O

9:08

Plays from YouTube. Watch on YouTube

How can one server respond to multiple connected clients without blocking on one idle client?

Meet select and Multiplexed I/O: an original animated lesson in C and Unix systems programming.

We start with fd_set, FD_ZERO, FD_SET, FD_ISSET and the highest-descriptor-plus-one rule.

From there, we rebuild readiness sets across iterations, accept new clients, handle EOF and keep separate buffers for incomplete messages.

The big idea: Multiplexing changes when I/O is attempted but not the need to manage buffers, clients and failures.

C and Unix explained visually, one concept at a time.