한 블록에 클라 API
브라우저/Node 클라 (socket.io-client) 가 단일 io() 호출. auto-reconnect, event 구독 + emit, callback-based 또는 promise-based ACK 지원하는 socket 리턴. 같은 SDK 가 Node, React Native, modern bundler 모두에서 작동.
Event 이름 임의 string
raw WebSocket 과 달리 message router 직접 안 만들어. 그냥 socket.on('chat:message', handler) + socket.emit('chat:message', payload). 라이브러리가 event 이름을 내부 frame type 에 매핑.
Acknowledgement: callback 또는 Promise
emit 의 마지막 인자에 callback 넘기면 라이브러리가 서버 ack 기다림. Promise-based API 위해선 emitWithAck. 서버쪽 event handler 가 값 또는 array 리턴하면 그게 ack data. correlation-ID 코드 안 짜고 request-response 됨.