onconnect method
void
onconnect()
Called by Namespace upon succesful
middleware execution (ie: authorization).
@api private
Implementation
void onconnect() {
// debug('socket connected - writing packet');
nsp.connected[id] = this;
join(id);
// Socket.IO v3+ protocol requires CONNECT response to include {sid} in
// data so the client can confirm the namespace is joined. Without it,
// socket_io_client v3.x emits a connect_error and never fires onConnect.
packet(<dynamic, dynamic>{'type': CONNECT, 'data': {'sid': id}});
}