Exemplo n.º 1
0
        private bool RunUpdate(DateTime utcNow)
        {
            var error = false;

            try
            {
                //Update negotiator (joining session, setting up ID etc)
                _serverNegotiator.Update(utcNow);

                //Poll network layer for more packets
                ReadMessages();

                //Send messages (put in send queue as part of reading/receiving messages)
                _sendQueue.Update();

                //Update voice receiver (not procesing packets, just general bookkeeping e.g. closing sessions due to timeouts)
                _voiceReceiver.Update(utcNow);
            }
            catch (Exception e)
            {
                Log.Error(e.Message);
                error = true;
            }
            finally
            {
                //Send events to event handlers
                if (_events.DispatchEvents())
                {
                    error = true;
                }
            }

            return(error);
        }
Exemplo n.º 2
0
        private bool RunUpdate(DateTime utcNow)
        {
            var error = false;

            try
            {
                //Update components
                _serverNegotiator.Update(utcNow);
                _sendQueue.Update();
                _voiceReceiver.Update(utcNow);

                //Poll network layer for more packets
                ReadMessages();
            }
            catch (Exception e)
            {
                Log.Error(e.Message);
                error = true;
            }
            finally
            {
                //Send events to event handlers
                if (_events.DispatchEvents())
                {
                    error = true;
                }
            }

            return(error);
        }