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