예제 #1
0
 public void Dispose()
 {
     service.Dispose();
     if (IsConnected)
     {
         pipeStream.Disconnect();
     }
     Stop();
     Debugger.Debug(LogLevel.Info, "PipeService: Closing server...");
     pipeStream.Close();
     Debugger.Debug(LogLevel.Info, "PipeService: Closed!");
 }
        public void Dispose()
        {
            try
            {
                if (IsConnected)
                {
                    pipeStream.Disconnect();
                    IsConnected = false;
                }

                if (waitThreadId != 0)
                {
                    waiterRunning = false;
                    ThreadHelpers.CancelSynchronousIo(waitThreadId);
                    waitForConnectionThread.Join();
                    waitThreadId = 0;
                }

                Debugger.Debug(LogLevel.Info, "Closing Event Emitter...");
                pipeStream.Close();
                Debugger.Debug(LogLevel.Info, "Closed Event Emitter!");
            }
            catch (Exception) { }
        }