code: function(callback) {
          waitForSocketToConnectTimeoutId && clearTimeout(waitForSocketToConnectTimeoutId);
  
          if (socket.readyState === 1) {
            callback();
          } else {
            waitForSocketToConnectTimeoutId = setTimeout(function() {
              if (socket.readyState === 1) {
                callback();
              } else {
                waitForSocketToConnect(callback);
              }
            }, wsConnectionWaitTime);
          }
        }
docs: *****************************************************
  P R I V A T E   M E T H O D S            *
  *****************************************************