Beispiel #1
0
        // TODO: Add other subscriber info and goodies

        internal void Disconnect()
        {
            m_enabled = false;
            m_tcpSocket?.Disconnect();
            m_udpSocket?.Disconnect();
            SubscriberDisconnected?.Invoke(this, new EventArgs <Subscriber>(this));
        }
Beispiel #2
0
        public bool DisconnectSubscriber(Guid id)
        {
            lock (m_subscribers)
            {
                Subscriber subscriber;

                if (m_subscribers.TryGetValue(id, out subscriber))
                {
                    subscriber.Disconnect();
                    SubscriberDisconnected?.Invoke(this, new EventArgs <Subscriber>(subscriber));
                    m_subscribers.Remove(id);
                    return(true);
                }
            }

            return(false);
        }