NetMQ.Poller.Dispose C# (CSharp) Метод

Dispose() защищенный Метод

Perform any freeing, releasing or resetting of contained resources. If this poller is already started, signal the polling thread to stop - and block to wait for it.
protected Dispose ( bool disposing ) : void
disposing bool true if releasing managed resources
Результат void
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
                return;

            if (!m_disposed)
            {
                // If this poller is already started, signal the polling thread to stop
                // and wait for it.
                if (m_switch.Status)
                    Cancel(true);

                m_disposed = true;                
            }
        }

Same methods

Poller::Dispose ( ) : void

Usage Example

Пример #1
0
 private void PollerThread()
 {
     while (true)
     {
         try
         {
             if (poller == null || !poller.IsStarted)
             {
                 SignalService.Logger.Info("Start NetMQ Poller");
                 poller = new Poller();
                 poller.AddSocket(router);
                 poller.Start();
             }
         }
         catch (Exception e)
         {
             SignalService.Logger.Error("NetMQ Poller Thread Exception.\n{0}", e.StackTrace);
             if (poller != null)
             {
                 poller.Stop();
                 poller.Dispose();
             }
         }
     }
 }
All Usage Examples Of NetMQ.Poller::Dispose