public InFlightPacket WriteState(NetOutgoingMessage inOutputStream)
        {
            InFlightPacket toRet = WriteSequenceNumber(inOutputStream);

            if (mShouldSendAcks)
            {
                WriteAckData(inOutputStream);
            }
            return(toRet);
        }
        public InFlightPacket WriteSequenceNumber(NetOutgoingMessage inOutputStream)
        {
            //write the sequence number, but also create an inflight packet for this...
            PacketSequenceNumber sequenceNumber = mNextOutgoingSequenceNumber++;

            inOutputStream.Write(sequenceNumber);

            ++mDispatchedPacketCount;

            if (mShouldProcessAcks)
            {
                var v = new InFlightPacket(sequenceNumber);
                mInFlightPackets.Enqueue(v);
                return(v);
            }
            else
            {
                return(null);
            }
        }
 public void HandlePacketDeliverySuccess(InFlightPacket inFlightPacket)
 {
     ++mDeliveredPacketCount;
     inFlightPacket.HandleDeliverySuccess(this);
 }
 public void HandlePacketDeliveryFailure(InFlightPacket inFlightPacket)
 {
     ++mDroppedPacketCount;
     inFlightPacket.HandleDeliveryFailure(this);
 }