/** * Processes the received list of participants **/ public void RecvParticipantListRsp(BinaryReader s) { ArrayList participants = new ArrayList(); int length = (int)s.ReadUInt16(); /* subtract bytes stored for total length */ length -= 2; while (length > 0) { string username = ""; UInt16 usernameLength = s.ReadUInt16(); if (usernameLength > 0) { username = new string(s.ReadChars(usernameLength)); } participants.Add(username); /* subtract bytes stored for length and string */ length -= (username.Length + 2); } listener.OnSessionParticipantListUpdate(participants); }