Ejemplo n.º 1
0
        public void SendPushShutdown(ReactorVirtualClient c)
        {
            EosPacket p = new EosPacket();

            p.Sender = ReactorServer.Id;
            p.Type   = EosPacketType.Shutdown;
            byte[] toSend = Encryption.AES_Encrypt(p.ToBytes(), c.Key, c.Salt);
            EosSignal.SendNotification(c.Address, SignalPort, toSend);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Send a push notification to a client with the specified username
        /// </summary>
        /// <param name="username"></param>
        /// <param name="p"></param>
        public void SendPushMessage(string username, EosPacket p)
        {
            var entry = (
                from c in TtlClients where Encoding.Unicode.GetString((byte[])c.Key.Tag) == username select c)
                        .SingleOrDefault();

            var client = entry.Key;

            p.Type = EosPacketType.Message;
            byte[] toSend = Encryption.AES_Encrypt(p.ToBytes(), client.Key, client.Salt);
            EosSignal.SendNotification(client.Address, SignalPort, toSend);
        }