Exemplo n.º 1
0
        private void OnGetPendingEventCompleted(object sender, GetPendingEventCompletedEventArgs e)
        {
            if (PollCompleted != null)
            {
                PollCompleted(this, e);
            }

            if (e.Error != null)
            {
                OnError(e.Error);
            }
            else
            {
                if (e.Result != null)
                {
                    if (e.Result.EventSet != null)
                    {
                        if (!_connectionOpened)
                        {
                            Platform.Log(LogLevel.Error, "Received messages after connection has been closed!");
                        }
                        else if (MessageReceived != null)
                        {
                            MessageReceived(this, new ServerEventReceivedEventArgs {
                                EventSet = e.Result.EventSet
                            });
                        }
                        else
                        {
                            Platform.Log(LogLevel.Error, "Received messages without message event registered!");
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void OnGetPendingEventCompleted(object sender, GetPendingEventCompletedEventArgs e)
        {
            Interlocked.Decrement(ref _pendingPollingCount);

            lock (_syncLock)
            {
                Monitor.PulseAll(_syncLock);
            }
        }
Exemplo n.º 3
0
        private void OnGetPendingEventCompleted(object sender, GetPendingEventCompletedEventArgs e)
        {
            if (PollCompleted != null)
                PollCompleted(this, e);

            if (e.Error != null)
            {
                OnError(e.Error);
            }
            else
            {
                if (e.Result != null)
                {
                    if (e.Result.EventSet != null)
                    {
                        if (!_connectionOpened)
                        {
                            Platform.Log(LogLevel.Error, "Received messages after connection has been closed!");
                        }
                        else if (MessageReceived != null)
                        {
                            MessageReceived(this, new ServerEventReceivedEventArgs {EventSet = e.Result.EventSet});
                        }
                        else
                        {
                            Platform.Log(LogLevel.Error, "Received messages without message event registered!");
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void OnGetPendingEventCompleted(object sender, GetPendingEventCompletedEventArgs e)
        {
            Interlocked.Decrement(ref _pendingPollingCount);

            lock (_syncLock)
            {
                Monitor.PulseAll(_syncLock);
            }          
        }