Example #1
0
            private void OnPipeReady(object sender, NetMQSocketEventArgs e)
            {
                NetMQMessage message = m_pipe.ReceiveMultipartMessage();

                string command = message.Pop().ConvertToString();

                switch (command)
                {
                case ConfigureCommand:
                    string interfaceName = message.Pop().ConvertToString();
                    int    port          = message.Pop().ConvertToInt32();
                    Configure(interfaceName, port);
                    break;

                case PublishCommand:
                    m_transmit           = message.Pop();
                    m_pingTimer.Interval = message.Pop().ConvertToInt32();
                    m_pingTimer.Enable   = true;
                    SendUdpFrame(m_transmit);
                    break;

                case SilenceCommand:
                    m_transmit         = null;
                    m_pingTimer.Enable = false;
                    break;

                case SubscribeCommand:
                    m_filter = message.Pop();
                    break;

                case UnsubscribeCommand:
                    m_filter = null;
                    break;

                case NetMQActor.EndShimMessage:
                    m_poller.Cancel();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
Example #2
0
        private void OnSocketReady(object sender, NetMQSocketEventArgs e)
        {
            NetMQMessage message = m_receiveSocket.ReceiveMultipartMessage();

            m_handler(m_receiveSocket, message);
        }