Exemplo n.º 1
0
 public override void Flush()
 {
     try
     {
         SendRequest();
     }
     finally
     {
         outputStream = new TMemoryStream();
     }
 }
Exemplo n.º 2
0
 public override void Close()
 {
     if (inputStream != null)
     {
         inputStream.Close();
         inputStream = null;
     }
     if (outputStream != null)
     {
         outputStream.Close();
         outputStream = null;
     }
 }
Exemplo n.º 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();
            }
        }