DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
API Development Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
API Development
In the broadcast implementation, why is checking readyState === OPEN necessary before calling client.send()?
A
It's unnecessary, sending to any tracked client is always safe
B
A socket can be in the process of closing (or already closed) before its close event handler has fired and removed it from tracking — sending to a non-open socket throws
C
readyState only matters for HTTP requests, not WebSockets
D
This check prevents duplicate messages
Check Answer