public ValueTask StartAsync(ObjectDelivererProtocol protocol, IPacketRule packetRule, IDeliveryBox <T>?deliveryBox = null)
        {
            if (protocol == null || packetRule == null)
            {
                return(default(ValueTask));
            }

            this.currentProtocol = protocol;
            this.currentProtocol.SetPacketRule(packetRule);

            this.deliveryBox = deliveryBox;

            this.currentProtocol.Connected.Subscribe(x =>
            {
                this.ConnectedList.Add(x.Target);
                this.connected.OnNext(x);
            });

            this.currentProtocol.Disconnected.Subscribe(x =>
            {
                this.ConnectedList.Remove(x.Target);
                this.disconnected.OnNext(x);
            });

            this.currentProtocol.ReceiveData.Subscribe(x =>
            {
                var data = new DeliverData <T>()
                {
                    Sender = x.Sender,
                    Buffer = x.Buffer,
                };

                if (deliveryBox != null)
                {
                    data.Message = deliveryBox.BufferToMessage(x.Buffer);
                }

                this.receiveData.OnNext(data);
            });

            this.ConnectedList.Clear();

            return(this.currentProtocol.StartAsync());
        }
 protected virtual void DispatchReceiveData(DeliverData deliverData)
 {
     this.receiveData?.OnNext(deliverData);
 }