onconnect method

void onconnect(
  1. dynamic id,
  2. dynamic pid
)

Called upon server connect.

@api private

Implementation

void onconnect(id, pid) {
  this.id = id;
  recovered = pid != null && _pid == pid;
  _pid = pid; // defined only if connection state recovery is enabled
  connected = true;
  emitBuffered();
  emitReserved("connect");
  _drainQueue(true);
}