Beispiel #1
0
        void IRequestQueue.Update()
        {
            if (_Connected() == false)
            {
                Disconnect();
                DisconnectEvent();
                return;
            }

            _SoulProvider.Update();

            RequestPackage pkg;

            while (_Requests.TryDequeue(out pkg))
            {
                System.Threading.Interlocked.Decrement(ref _TotalRequest);
                var request = _TryGetRequest(pkg);

                if (request != null)
                {
                    if (_InvokeMethodEvent != null)
                    {
                        _InvokeMethodEvent(request.EntityId, request.MethodId, request.ReturnId, request.MethodParams);
                    }
                }
            }

            var responses = _ResponsePop();

            if (responses.Length > 0)
            {
                _Writer.Push(responses);
            }
        }
Beispiel #2
0
        void _Update()
        {
            _SoulProvider.Update();

            RequestPackage pkg;

            while (_Requests.TryDequeue(out pkg))
            {
                System.Threading.Interlocked.Decrement(ref _TotalRequest);
                Request request = _TryGetRequest(pkg);

                if (request != null)
                {
                    if (_InvokeMethodEvent != null)
                    {
                        _InvokeMethodEvent(request.EntityId, request.MethodId, request.ReturnId, request.MethodParams);
                    }
                }
            }

            ResponsePackage[] responses = _ResponsePop();

            if (responses.Length > 0)
            {
                _Writer.Push(responses);
            }
        }
Beispiel #3
0
        void _AsyncUpdate()
        {
            _SoulProvider.Update();

            _Writer.Push(_ResponsePop());

            _Reader.Update();

            _ExecuteRequests();
        }
Beispiel #4
0
 private void _Update()
 {
     _SoulProvider.Update();
     _GhostRequest.Update();
 }