function onReset() {
      // Remove our listeners so this function is cleaned up 
      client.removeListener("error", onReset);
      client.removeListener("end", onReset);
      if (singletonClient !== client) {
       	// This client is no longer the singletonClient, so don't try and reset it
        return;
      }
      // Reset the client
      singletonClient = undefined;
    }
// We want to reset the client if we run into an issue that we can't handle, or for some reason our client was closed
We want to reset the client if we run into an issue that we can't handle, or for some reason our client was closed
We want to reset the client if we run into an issue that we can ' t handle or for some reason our client was closed
function onReset() {
      client.removeListener("error", onReset);
      client.removeListener("end", onReset);
      if (singletonClient !== client) {
        return;
      }
      singletonClient = undefined;
    }
function onReset ( ) { client . removeListener ( "error" , onReset ) ; client . removeListener ( "end" , onReset ) ; if ( singletonClient !== client ) { return ; } singletonClient = undefined ; }
We want to reset the client if we run into an issue that we can't handle, or for some reason our client was closed
We want to reset the client if we run into an issue that we can ' t handle or for some reason our client was closed
// Remove our listeners so this function is cleaned up  // This client is no longer the singletonClient, so don't try and reset it // Reset the client