Ejemplo n.º 1
0
        private void _padder_Receive(object sender, SegmentMessage <TSender> e)
        {
            if (e.IsOwnMessage)
            {
                this._timeoutResetEvent.Set();

                this.ResendMissed(e.Data);
                this.FlushBuffer();
            }

            if (e.Data.Count == 0)
            {
                return;
            }
            var location = (byte)(e.Data.Array[e.Data.Offset] - Config.CounterOffset);
            var data     = ByteHelper.CropArray(e.Data, 1);

            this.Receive?.Invoke(this,
                                 new OrderedMessage <TSender>(
                                     e.Sender, e.IsOwnMessage,
                                     location, data));
        }
Ejemplo n.º 2
0
 private void _networkChannel_Receive(object sender, Message <TSender> e)
 {
     this.Receive?.Invoke(this,
                          new SegmentMessage <TSender>(e.Sender, e.IsOwnMessage,
                                                       ByteHelper.RemoveTrail(e.Data)));
 }
Ejemplo n.º 3
0
 public void Send(byte[] data)
 {
     this._networkChannel.Send(ByteHelper.AddTrail(data, this._networkChannel.Size));
 }