Пример #1
0
        private void PublishCallback(Guid eventType, WspEvent wspEvent)
        {
            SubscribeEvent subscribeEvent;

            subscribeEvent = new SubscribeEvent(wspEvent.Body);

            Thread.Sleep(0);

            if (subscribeEvent.InstanceId == instanceId)
            {
                lock (obj)
                {
                    counter++;

                    pubEvent.EventNum++;

                    while (true)
                    {
                        try
                        {
                            eventPush.OnNext(new WspEvent(pubEvent.EventType, null, pubEvent.Serialize()));

                            break;
                        }
                        catch
                        {
                            Thread.Sleep(2);
                        }
                    }
                }

                SetTextbox(eventNumberSent, counter.ToString());
            }
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();

            pubEvent            = new PublishEvent();
            pubEvent.InstanceId = instanceId;

            subEvent = new SubscribeEvent();

            eventPush = new WspEventPublish();

            stopPubSubButton.Checked = true;
            stopPubSubButton.Select();
        }