示例#1
0
        public void WriteTCP(MeterCommand command)
        {
            var sender = JsonSerializer.Serialize(command);

            foreach (var item in server.GetClients())
            {
                server.Send(item, Encoding.UTF8.GetBytes(sender));
            }
        }
示例#2
0
        public void WriteTCP(MeterCommand command)
        {
            var sender  = JsonSerializer.Serialize(command);
            var encrypt = Protector.Encrypt(sender, "secret");

            foreach (var item in server.GetClients())
            {
                server.Send(item, Encoding.UTF8.GetBytes(encrypt));
            }
        }