Exemple #1
0
        private void _dataBlockSent(DataSentController controller)
        {
            SentBytesCount += controller.SentBytes;

            _serverController.DataSent(controller);
        }
Exemple #2
0
 /// <summary>
 /// Handle client that which data sent was completed.
 /// </summary>
 /// <param name="controller">Controller of the client.</param>
 internal void Report_DataSent(DataSentController controller)
 {
     _dataBlockSentHandler(controller);
 }
Exemple #3
0
 internal virtual void DataSent(DataSentController controller)
 {
     //by default we do nothing
 }
Exemple #4
0
        /// <summary>
        /// Handles event which is fired after data was sent.
        /// </summary>
        /// <param name="controller">Controller with client </param>
        internal void Handle_DataSent(DataSentController controller)
        {
            var clientInternal = controller.ClientInternal;
            if (clientInternal.ActualSendBlock.DataSize != clientInternal.SendEventArgs.BytesTransferred)
                //we don't expect that it may happen
                throw new NotSupportedException("Partial block sending");

            _pool.Report_DataSent(controller);

            //prepare new block for sending
            var sentBlock = clientInternal.ActualSendBlock;
            clientInternal.ActualSendBlock = sentBlock.Next;

            //release chain of sent block
            releaseChain(sentBlock);

            if (clientInternal.ActualSendBlock != null)
                throw new NotImplementedException("handle sending of chained blocks");
        }