Example #1
0
 public void UpdateSocket()
 {
     if (socket.HasIn)
     {
         socket.Poll();
     }
 }
        private void ExecuteComThreadReceiveImages()
        {
            try
            {
                using (var subSocket = new SubscriberSocket())
                {
                    subSocket.Options.ReceiveHighWatermark = 2;
                    subSocket.Connect(Config.GetConnectionString4Images());
                    subSocket.SubscribeToAnyTopic();
                    subSocket.ReceiveReady += OnReceiveImageMessage;

                    while (!IsDisposed)
                    {
                        var success = subSocket.Poll(TimeSpan.FromSeconds(1));
                    }
                }
            }
            catch (Exception exp)
            {
                LastException = exp;
            }
        }
        private void ExecuteComThreadReceiveControlMessages()
        {
            try
            {
                using (var subSocket = new SubscriberSocket())
                {
                    subSocket.Options.ReceiveHighWatermark = 50;
                    subSocket.Connect(this.Config.GetConnectionStringCore4Receiving());
                    subSocket.Subscribe(this.Config.Name);
                    subSocket.ReceiveReady += OnReceiveControlMessage;

                    while (!IsDisposed)
                    {
                        var success = subSocket.Poll(TimeSpan.FromSeconds(1));
                    }
                }
            }
            catch (Exception exp)
            {
                LastException = exp;
            }
        }