/// <summary>
 /// Waits for the termination of the internal thread and closes the pipe.
 /// Even if this can be called immediately, you should first call <see cref="WaitEnd(bool)"/>
 /// before calling Dispose.
 /// </summary>
 public void Dispose()
 {
     if (_endFlag == LogReceiverEndStatus.None)
     {
         _thread.Join();
     }
     _reader.Dispose();
     _server.Dispose();
 }
예제 #2
0
 void Close(bool throwError)
 {
     if (_stream != null)
     {
         _current = null;
         _binaryReader.Dispose();
         _stream       = null;
         _binaryReader = null;
     }
     if (throwError)
     {
         throw new InvalidOperationException("Invalid log data.");
     }
 }