Beispiel #1
0
        public override string ToString()
        {
            var id = Identifier;

            if (id == Ungrouped)
            {
                id = "<UNGROUPED>";
            }

            if (RealtimeClients.Count == 0)
            {
                return("(" + id + "@<DISCONNECTED>)");
            }

            return("(" + id + "@" + RealtimeClients.Select(e => e.Endpoint.Address + ":" + e.Endpoint.Port).Aggregate((a, b) => a + "," + b) + ")");
        }
Beispiel #2
0
        /// <summary>
        /// Isolates the group to use only one, connected Mx client, and disconnects
        /// the rest.
        /// </summary>
        public void Isolate()
        {
            if (RealtimeClients.Count == 0)
            {
                return;
            }

            var selectedClient = RealtimeClients.First(x => x.HasReceivedPacket);

            foreach (var client in RealtimeClients.ToArray())
            {
                if (!client.Endpoint.Equals(selectedClient.Endpoint))
                {
                    _dispatcher.Disconnect(client);
                }
            }
        }