Esempio n. 1
0
        public void SendSignal(object state)
        {
            NotificationFactory factory      = NotificationFactory.Instance;
            INotification       notification = factory.CreateNotification(NotificationType.Time);

            // Send
            foreach (var x in TtlClients)
            {
                string username = Encoding.Unicode.GetString((byte[])x.Key.Tag);
                // Strategy Pattern implementation
                ISendStrategy strategy = new ConcreteDefaultSender();
                strategy.SendPacket(notification.CreatePacket(), this, username);
            }

            //EosPacket p = new EosPacket();
            //p.Sender = ReactorServer.Id;
            //p.Data.Add(Encoding.Unicode.GetBytes(DateTime.Now.ToString()));
        }