code: function socketOnError() {
    const websocket = this[kWebSocket];
  
    this.removeListener('error', socketOnError);
    this.on('error', NOOP);
  
    websocket.readyState = WebSocket.CLOSING;
    this.destroy();
  }
docs: The listener of the `net.Socket` `'error'` event.
  
  @private