public NetMQMonitor(NetMQSocket monitoredSocket, string endpoint, SocketEvents eventsToMonitor)
        {
            Endpoint = endpoint;
            Timeout  = TimeSpan.FromSeconds(0.5);

            monitoredSocket.Monitor(endpoint, eventsToMonitor);

            m_monitoringSocket = new PairSocket();
            m_monitoringSocket.Options.Linger = TimeSpan.Zero;
            m_monitoringSocket.ReceiveReady  += Handle;

            m_ownsMonitoringSocket = true;
        }
Example #2
0
        /// <summary>
        /// </summary>
        public NetMQMonitor([NotNull] NetMQSocket monitoredSocket, [NotNull] string endpoint, SocketEvents eventsToMonitor)
        {
            this.Endpoint = endpoint;
            this.Timeout  = TimeSpan.FromSeconds(0.5);

            monitoredSocket.Monitor(endpoint, eventsToMonitor);

            this.m_monitoringSocket = new PairSocket();
            this.m_monitoringSocket.Options.Linger = TimeSpan.Zero;
            this.m_monitoringSocket.ReceiveReady  += this.Handle;

            this.m_ownsMonitoringSocket = true;
        }
Example #3
0
        public NetMQMonitor([NotNull] NetMQContext context, [NotNull] NetMQSocket monitoredSocket, [NotNull] string endpoint, SocketEvents eventsToMonitor)
        {
            Endpoint = endpoint;
            Timeout  = TimeSpan.FromSeconds(0.5);

            monitoredSocket.Monitor(endpoint, eventsToMonitor);

            m_monitoringSocket = context.CreatePairSocket();
            m_monitoringSocket.Options.Linger = TimeSpan.Zero;
            m_monitoringSocket.ReceiveReady  += Handle;

            m_ownsMonitoringSocket = true;
        }