WebSockets: Adding Real-Time Data to Your App with SwiftNIO and Network Framework
summary
WebSockets become native on iOS 13 with URLSession WebSocketTask (Network Framework under the hood); a demo builds a Vapor + SwiftNIO server that streams fake stock quotes and an iOS client that receives them. Initial server loop blocks threads and memory grows; replacing the loop with event-loop futures and workers fixes bi‑directional messaging and stabilizes memory, proving a SwiftNIO-based server plus native client works reliably over WS/WSs.
AI-written summary · about
chapters (14)
- 0:00Real-time data with WebSockets
- 1:45HTTP protocols and real-time hacks
- 9:56Polling, long polling, and SSE
- 12:22WebSocket protocol basics
- 16:46WebSocket handshake and security
- 17:06SwiftNIO for networking
- 23:06Server-side Swift with Vapor/NIO
- 26:01WebSocket server with Vapor
- 29:40Network Framework for clients
- 32:09Real-time stock ticker app
- 37:12Client-server WebSocket connection
- 39:00Fixing blocking in WebSocket servers
- 41:50Threading with SwiftNIO workers
- 45:01Resources and closing
related talks
29mWebSockets Bring Light at the End of the Tunnel
30mWebSockets: The Real-Time Avengers
37mHow does Server Side Swift Workout in the Real World?
40mSocket to me
22mReal-Time Video Streaming with WebSockets in React Native
01h 28mIntroduction to WebSockets
27mA Practical Introduction to WebSockets
01h 01mGet rich quick! Using Boost.Beast WebSockets and Networking TS
