Beispiel #1
0
        /// <summary>
        ///     setup the client with standard values
        ///     verbose == false
        ///     Connect the client to broker
        /// </summary>
        private MDPClientAsync()
        {
            m_client             = null;
            m_connected          = false;
            m_currentBrokerIndex = -1; // TODO use random!?

            m_pollerQueue = new NetMQQueue <Action>();
            m_pollerQueue.ReceiveReady += (sender, args) => OnAction(args);

            m_requestQueue = new RequestsQueue();
            m_requestQueue.FailedRequest += (s, e) => OnFailedRequest(e);

            m_poller = new NetMQPoller();
            Timeout  = m_defaultTimeOut;

            m_timer          = new NetMQTimer(m_purgeCheckTime);
            m_timer.Enable   = false;
            m_timer.Elapsed += (s, e) => OnPurgeRequest();
            m_poller.Add(m_timer);
            m_poller.Add(m_pollerQueue);

            m_poller.Add(m_timer);
            m_poller.RunAsync();
        }
Beispiel #2
0
        /// <summary>
        ///     setup the client with standard values
        ///     verbose == false
        ///     Connect the client to broker
        /// </summary>
        private MDPClientAsync()
        {
            m_client = null;
            m_connected = false;
            m_currentBrokerIndex = -1; // TODO use random!?

            m_pollerQueue = new NetMQQueue<Action>();
            m_pollerQueue.ReceiveReady += (sender, args) => OnAction(args);

            m_requestQueue = new RequestsQueue();
            m_requestQueue.FailedRequest += (s, e) => OnFailedRequest(e);

            m_poller = new NetMQPoller();
            Timeout = m_defaultTimeOut;

            m_timer = new NetMQTimer(m_purgeCheckTime);
            m_timer.Enable = false;
            m_timer.Elapsed += (s, e) => OnPurgeRequest();
            m_poller.Add(m_timer);
            m_poller.Add(m_pollerQueue);

            m_poller.Add(m_timer);
            m_poller.RunAsync();
        }