Exemplo n.º 1
0
        public void StopNIDSEvent()
        {
            if (_event != null)
            {
                _event.Set();
            }

            if (_thread == null)
            {
                return;
            }

            if (_thread.Join(3000))
            {
                _thread.Abort();
                _thread = null;
            }

            //将ZMQ的内容,销毁
            foreach (var tag in EventTags)
            {
                _subscriber.Unsubscribe(tag, MsgEncoding);
            }
            _subscriber.Dispose();
            _context.Dispose();
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     if (_zeromqContext != null)
     {
         _zeromqContext.Dispose();
     }
 }
Exemplo n.º 3
0
        public void Dispose()
        {
            isRunning = false;
            itemsReadyToSend.Set(); // wake up the send thread

            //wait till the threads have closed their sockets before closing the context
            while (threadStillRunning != 0)
            {
                Thread.Sleep(1);
            }

            CTX.Dispose();
        }