Exemple #1
0
 public override void Flush()
 {
     try
     {
         SendRequest();
     }
     finally
     {
         outputStream = new TMemoryStream();
     }
 }
Exemple #2
0
 public override void Close()
 {
     if (inputStream != null)
     {
         inputStream.Close();
         inputStream = null;
     }
     if (outputStream != null)
     {
         outputStream.Close();
         outputStream = null;
     }
 }
Exemple #3
0
        public override void EndFlush(IAsyncResult asyncResult)
        {
            try
            {
                var flushAsyncResult = (FlushAsyncResult)asyncResult;

                if (!flushAsyncResult.IsCompleted)
                {
                    var waitHandle = flushAsyncResult.AsyncWaitHandle;
                    waitHandle.WaitOne();  // blocking INFINITEly
                    waitHandle.Close();
                }

                if (flushAsyncResult.AsyncException != null)
                {
                    throw flushAsyncResult.AsyncException;
                }
            }
            finally
            {
                outputStream = new TMemoryStream();
            }
        }