onconnect method

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

Called upon server connect.

@api private

Implementation

void onconnect(id, pid) {
  this.id = id;
  this.pid = pid; // defined only if connection state recovery is enabled
  connected = true;
  disconnected = false;
  emit('connect');
  emitBuffered();
}