예제 #1
0
        void ISaiConnectionObserver.OnSaiUserDataArrival(uint remoteID, byte[] userData, long timeDelay, MessageDelayDefenseTech defenseTech)
        {
            try
            {
                var pkg = new IncomingPackage(remoteID, userData, timeDelay, defenseTech);

                _productCacheReceive.AddTail(pkg);

                this.CheckIncomgCacheThreshold();
            }
            catch (System.Exception)
            {
            }
        }
예제 #2
0
        private void NotifyIncomingUserDataEvent(IncomingPackage pkg)
        {
            if (this.UserDataIncoming != null)
            {
                this.UserDataIncoming.GetInvocationList().ToList().ForEach(handler =>
                {
                    try
                    {
                        var args = new UserDataIncomingEventArgs(pkg);
                        args.Package.QueuingDelay = (UInt32)((DateTime.Now - args.Package.CreationTime).TotalMilliseconds / 10);

                        handler.DynamicInvoke(null, args);
                    }
                    catch (System.Exception)
                    {
                    }
                });
            }
        }