Theory of Intelligence
BACKEND ENGINEERING•Linux And Networking•Real Time And Edge•3.1 WebSockets & Server-Sent Events

3.1.1 WebSockets

Subtopics: WebSockets and Server-Sent Events.

3.1.1 WebSockets

After an HTTP upgrade, both sides send frames until someone closes. Good for chat, presence, and live boards.

Why it matters

Polling every second is wasteful and laggy. WebSockets push in milliseconds.

How it is used

Terminate at a sticky or pub/sub-aware layer (socket.io + Redis). Heartbeat so idle load balancers do not kill the socket. Fall back to SSE or polling on hostile networks.

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!