lib/websocket.js
function receiverOnConclude(code, reason) {
  const websocket = this[kWebSocket];

  websocket._socket.removeListener('data', socketOnData);
  websocket._socket.resume();

  websocket._closeFrameReceived = true;
  websocket._closeMessage = reason;
  websocket._closeCode = code;

  if (code === 1005) websocket.close();
  else websocket.close(code, reason);
}
function receiverOnConclude(code, reason) {
  const websocket = this[kWebSocket];

  websocket._socket.removeListener('data', socketOnData);
  websocket._socket.resume();

  websocket._closeFrameReceived = true;
  websocket._closeMessage = reason;
  websocket._closeCode = code;

  if (code === 1005) websocket.close();
  else websocket.close(code, reason);
}
function receiverOnConclude ( code , reason ) { const websocket = this [ kWebSocket ] ; websocket . _socket . removeListener ( 'data' , socketOnData ) ; websocket . _socket . resume ( ) ; websocket . _closeFrameReceived = true ; websocket . _closeMessage = reason ; websocket . _closeCode = code ; if ( code === 1005 ) websocket . close ( ) ; else websocket . close ( code , reason ) ; }
The listener of the `Receiver` `'conclude'` event.

@param {Number} code The status code
@param {String} reason The reason for closing
@private
The listener of the Receiver conclude event .