onOpen method

void onOpen()

Called upon transport considered open.

Implementation

void onOpen() {
  readyState = 'open';

  // sends an `open` packet
  transport.sid = id;
  sendPacket('open',
      data: json.encode({
        'sid': id,
        'upgrades': getAvailableUpgrades(),
        'pingInterval': server.pingInterval,
        'pingTimeout': server.pingTimeout
      }));

  emit('open');
  setPingTimeout();
}