Ejemplo n.º 1
0
        public SparUdpport(string key)
        {
            if (!string.IsNullOrWhiteSpace(key))
            {
                _aes = new Aes(key);
            }

            this.OnDataIn += (o, e) =>
            {
                /*if (OnAesDataIn != null)
                 *  OnAesDataIn(_aes == null ? e.Datagram : _aes.Decode(e.DatagramB));*/
                OnAesDataIn?.Invoke(_aes == null ? e.Datagram : _aes.Decode(e.DatagramB));
            };
        }
Ejemplo n.º 2
0
        public SparIpdaemon(string key)
        {
            if (!string.IsNullOrWhiteSpace(key))
            {
                _aes = new Aes(key);
            }

            this.OnDataIn += (o, e) =>
            {
                OnAesDataIn?.Invoke(o, e, _aes == null ? e.Text : _aes.Decode(e.TextB));

                /*if (OnAesDataIn != null)
                 *  OnAesDataIn(o, e, _aes == null ? e.Text : _aes.Decode(e.TextB));*/
            };
        }