예제 #1
0
        public void Stop()
        {
            _serverStopped = true;

            if (_messageThread?.IsAlive == true)
            {
                _protocolChannel.Dispose();
                _messageThread.Interrupt();
            }
        }
 /// <summary>
 ///     Destroys the transaction processor and its dependencies. Ensures that the
 ///     <see cref="Channel" /> is closed. Once this method has been called, the
 ///     <see cref="Channel" /> and <see cref="Endpoint" /> properties will be null. A new
 ///     connection to the same endpoint can be created by calling
 ///     <see cref="CreateTransactionProcessor" /> again.
 /// </summary>
 public void DestroyTransactionProcessor()
 {
     processor?.Dispose();
     processor = null; // [Sentinel]
     observer  = null;
     if (Channel?.IsOpen ?? false)
     {
         Channel.Close();
     }
     Channel?.Dispose();
     Channel = null; // [Sentinel]
     GC.Collect(3, GCCollectionMode.Forced, blocking: true);
 }
예제 #3
0
 private void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     Close();
     ReleaseUnmanagedResources();
     if (disposing)
     {
         channel.Dispose();
     }
     disposed = true;
 }
예제 #4
0
 private void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     log.Debug().Message("Disposing").Write();
     Close();
     ReleaseManagedResources();
     if (disposing)
     {
         channel.Dispose();
     }
     disposed = true;
 }
예제 #5
0
 public void Dispose()
 {
     _channel?.Dispose();
 }