function isClosed (ws) {
  return ws[kReadyState] === states.CLOSED
}
@see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
@param {import('./websocket').WebSocket} ws
@param {number} type Opcode
@param {Buffer} data application data