コード例 #1
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <remarks></remarks>
        public void Dispose()
        {
            lock (this)
            {
                if (disposed)
                {
                    return;
                }
                disposed = true;
            }

            if (!disableRemoting)
            {
                Log.Info("Disconnecting remote server: ");
                RemotingServices.Disconnect((MarshalByRefObject)server.CruiseManager);
                RemotingServices.Disconnect((MarshalByRefObject)server.CruiseServerClient);
                foreach (IChannel channel in ChannelServices.RegisteredChannels)
                {
                    Log.Info("Unregistering channel: " + channel.ChannelName);
                    ChannelServices.UnregisterChannel(channel);
                }
            }

            server.Dispose();
        }
コード例 #2
0
 void IDisposable.Dispose()
 {
     if (_disposed)
     {
         return;
     }
     _disposed = true;
     Log.Info("Disconnecting remote server: ");
     RemotingServices.Disconnect((MarshalByRefObject)_server.CruiseManager);
     foreach (IChannel channel in ChannelServices.RegisteredChannels)
     {
         Log.Info("Unregistering channel: " + channel.ChannelName);
         ChannelServices.UnregisterChannel(channel);
     }
     _server.Dispose();
 }
コード例 #3
0
 public void Dispose()
 {
     watcher.Dispose();
     server.Dispose();
 }
コード例 #4
0
 private void HandleControlEvent(object sender, EventArgs args)
 {
     server.Dispose();
 }