onHandshake method

void onHandshake(
  1. Map data
)

Called upon handshake completion.

@param {Object} handshake obj @api private

Implementation

void onHandshake(Map data) {
  emit('handshake', data);
  id = data['sid'];
  transport!.query!['sid'] = data['sid'];
  upgrades = filterUpgrades(data['upgrades']);
  pingInterval = data['pingInterval'];
  pingTimeout = data['pingTimeout'];
  onOpen();
  // In case open handler closes socket
  if ('closed' == readyState) return;
  setPing();

  // Prolong liveness of socket on heartbeat
  off('heartbeat', onHeartbeat);
  on('heartbeat', onHeartbeat);
}