Called once, when the socket closes for any reason.
The close code and reason
Called when the socket reports a transport-level error. A socket that
errors is also expected to close, so implementations must tolerate
WebSocketEventSink.onClose arriving afterwards.
The normalized error
Called for every inbound frame.
Text frames arrive as string, binary frames as Uint8Array
Called once, when the socket is live and writable.
The normalized socket
The callbacks an HTTP adapter drives once it has completed a handshake. The WebSocket plugin builds one sink per accepted upgrade and hands it to the adapter inside the accept decision; the adapter binds its native socket events to these methods.
This is the inversion that keeps runtime differences out of the plugin: the adapter knows how to listen, the sink knows what to do.
Since
0.2.0