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) { } }
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) { } }); } }