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

PollTillCancelled() публичный Метод

Poll till Cancel or CancelAndJoin is called. This is a blocking method.
public PollTillCancelled ( ) : void
Результат void
        public void PollTillCancelled()
        {
            PollWhile(() => m_cancel == 0);
        }

Usage Example

Пример #1
0
        public void Run(params string[] addresses)
        {
            using (m_context = NetMQContext.Create())
              {
            var subscriber = Connect(addresses);

            if (subscriber == null)
              throw new Exception("cannot connect to eny of the endpoints");

            // timeout timer, when heartbeat was not arrived for 5 seconds
            m_timeoutTimer = new NetMQTimer(TimeSpan.FromSeconds(5));
            m_timeoutTimer.Elapsed += (sender, args) =>
            {
              // timeout happend, first dispose existing subscriber
              subscriber.Dispose();
              m_poller.RemoveSocket(subscriber);

              // connect again
              subscriber = Connect(addresses);

              if (subscriber == null)
            throw new Exception("cannot connect to eny of the endpoints");

              m_poller.AddSocket(subscriber);
            };

            m_poller = new Poller(subscriber);
            m_poller.AddTimer(m_timeoutTimer);

            m_poller.PollTillCancelled();
              }
        }
All Usage Examples Of NetMQ.Poller::PollTillCancelled