What I learned from sockets
summary
Asserts that the socket select pattern generalizes: wait once for events, then run straight‑line handlers; demonstrates using POSIX primitives like epoll/kqueue and poll, adding timerfd for timeouts, and applying the happy eyeballs algorithm to race multiple connects. Builds a C++ “select object” and in‑process selectable pipe handles, shows cooperative subscribe/notify mechanics, supports cancellation via an extra socket, and compiles and runs the examples.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 1:06Select and its power
- 3:35Sockets and file descriptors
- 10:59Blocking vs non-blocking I/O
- 12:03Select for concurrent waiting
- 14:55Select limitations and alternatives
- 17:00Poll vs Select
- 18:03EPOLL for efficient events
- 20:30Async code with EPOLL
- 20:51Happy Eyeballs algorithm
- 23:59Happy Eyeballs with EPOLL
- 26:31Cancellation and timeouts
- 28:59Cancelling with Unix sockets
- 35:23Async patterns in C++
- 37:07C++ Select-like mechanism
- 40:00User-space pipe with handles
- 43:30Non-blocking pipe operations
- 45:18Selectable handles
- 49:57User-space Select object
- 51:42Lazy subscription
- 54:11Select internals and fairness
- 56:01Demo: Selectable pipe
- 57:48Sender-receiver proposal
- 59:16Q&A
related talks
01h 06mApplying Unix Readiness Model for Concurrent Operations in C++
57mStructured Networking in C++
26mTCP Sockets Programming in Ruby
01h 01mPractical Patterns with the Networking TS
59mThe Networking TS in Practice: Patterns for Real World Problems
01h 01mStructured Networking
01h 21mTutorial: Developing High-performance Networking Applications
15mBeyond OS Sockets: Custom Socket Interfaces in Envoy
