public ApplePushService(IPushChannelFactory pushChannelFactory, ApplePushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new ApplePushChannelFactory(), channelSettings, serviceSettings) { var appleChannelSettings = channelSettings; cancelTokenSource = new CancellationTokenSource(); //allow control over feedback call interval, if set to zero, don't make feedback calls automatically if (appleChannelSettings.FeedbackIntervalMinutes > 0) { feedbackService = new FeedbackService(); feedbackService.OnFeedbackReceived += feedbackService_OnFeedbackReceived; feedbackService.OnFeedbackException += (Exception ex) => this.RaiseServiceException (ex); if (timerFeedback == null) { timerFeedback = new Timer(new TimerCallback((state) => { try { feedbackService.Run(channelSettings as ApplePushChannelSettings, this.cancelTokenSource.Token); } catch (Exception ex) { base.RaiseServiceException(ex); } //Timer will run first after 10 seconds, then every 10 minutes to get feedback! }), null, TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(appleChannelSettings.FeedbackIntervalMinutes)); } } //Apple has documented that they only want us to use 20 connections to them base.ServiceSettings.MaxAutoScaleChannels = 20; }
public ApplePushService(IPushChannelFactory pushChannelFactory, ApplePushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? (IPushChannelFactory) new ApplePushChannelFactory(), (IPushChannelSettings)channelSettings, serviceSettings) { ApplePushService applePushService = this; ApplePushChannelSettings pushChannelSettings = channelSettings; this.cancelTokenSource = new CancellationTokenSource(); if (pushChannelSettings.FeedbackIntervalMinutes > 0) { this.feedbackService = new FeedbackService(); this.feedbackService.OnFeedbackReceived += new FeedbackService.FeedbackReceivedDelegate(this.feedbackService_OnFeedbackReceived); this.feedbackService.OnFeedbackException += (FeedbackService.FeedbackExceptionDelegate)(ex => applePushService.RaiseServiceException(ex)); if (this.timerFeedback == null) { this.timerFeedback = new Timer((TimerCallback)(state => { try { applePushService.feedbackService.Run(channelSettings, applePushService.cancelTokenSource.Token); } catch (Exception ex) { applePushService.RaiseServiceException(ex); } }), (object)null, TimeSpan.FromSeconds(10.0), TimeSpan.FromMinutes((double)pushChannelSettings.FeedbackIntervalMinutes)); } } this.ServiceSettings.MaxAutoScaleChannels = 20; }
public ApplePushService(IPushChannelFactory pushChannelFactory, ApplePushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new ApplePushChannelFactory(), channelSettings, serviceSettings) { var appleChannelSettings = channelSettings; cancelTokenSource = new CancellationTokenSource(); //allow control over feedback call interval, if set to zero, don't make feedback calls automatically if (appleChannelSettings.FeedbackIntervalMinutes > 0) { feedbackService = new FeedbackService(); feedbackService.OnFeedbackReceived += feedbackService_OnFeedbackReceived; feedbackService.OnFeedbackException += (Exception ex) => this.RaiseServiceException(ex); if (timerFeedback == null) { timerFeedback = new Timer(new TimerCallback((state) => { try { feedbackService.Run(channelSettings as ApplePushChannelSettings, this.cancelTokenSource.Token); } catch (Exception ex) { base.RaiseServiceException(ex); } //Timer will run first after 10 seconds, then every 10 minutes to get feedback! }), null, TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(appleChannelSettings.FeedbackIntervalMinutes)); } } //Apple has documented that they only want us to use 20 connections to them base.ServiceSettings.MaxAutoScaleChannels = 20; }
protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) { this.PushChannelFactory = pushChannelFactory; this.ServiceSettings = serviceSettings ?? (IPushServiceSettings) new PushServiceSettings(); this.ChannelSettings = channelSettings; this.queuedNotifications = new NotificationQueue(); this.scaleSync = 0; this.timerCheckScale = new Timer(new TimerCallback(this.CheckScale), (object)null, TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0)); this.CheckScale((object)null); this.stopping = false; }
protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) { this.PushChannelFactory = pushChannelFactory; this.ServiceSettings = serviceSettings ?? new PushServiceSettings(); this.ChannelSettings = channelSettings; this.queuedNotifications = new ConcurrentQueue <INotification>(); timerCheckScale = new Timer(CheckScale, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5)); CheckScale(); stopping = false; }
protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) { this.PushChannelFactory = pushChannelFactory; this.ServiceSettings = serviceSettings ?? new PushServiceSettings(); this.ChannelSettings = channelSettings; this.queuedNotifications = new ConcurrentQueue<INotification>(); timerCheckScale = new Timer(CheckScale, null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15)); CheckScale(); stopping = false; }
public FacebookPushService(IPushChannelFactory pushChannelFactory, FacebookPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public BlackberryPushService(IPushChannelFactory pushChannelFactory, BlackberryPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new BisPushChannelFactory(), channelSettings ?? new BlackberryPushChannelSettings(), serviceSettings) { }
public BlackberryPushService(IPushChannelFactory pushChannelFactory, BlackberryPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public BISPushService(IPushChannelFactory pushChannelFactory, BISPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new BISPushChannelFactory(), channelSettings ?? new BISPushChannelSettings(), serviceSettings) { }
public ApplePushService(IPushChannelFactory pushChannelFactory, ApplePushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public GcmPushService(IPushChannelFactory pushChannelFactory, GcmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new GcmPushChannelFactory(), channelSettings, serviceSettings) { }
public WindowsPhonePushService(IPushChannelFactory pushChannelFactory, WindowsPhonePushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new WindowsPhonePushChannelFactory(), channelSettings ?? new WindowsPhonePushChannelSettings(), serviceSettings) { }
public ApplePushService(IPushChannelFactory pushChannelFactory, ApplePushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, (IPushServiceSettings)null) { }
/// <summary> /// Initializes a new instance of the <see cref="FirefoxOSPushService"/> class. /// </summary> /// /// <param name="pushChannelFactory">Channel factory.</param> public FirefoxOSPushService(IPushChannelFactory pushChannelFactory) : base(pushChannelFactory ?? new FirefoxOSPushChannelFactory(), default(IPushChannelSettings), default(IPushServiceSettings)) { }
public FacebookPushService(IPushChannelFactory pushChannelFactory, FacebookPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new FacebookPushChannelFactory(), channelSettings, serviceSettings) { }
protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, (IPushServiceSettings)null) { }
protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public WindowsPushService(IPushChannelFactory pushChannelFactory, WindowsPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public WindowsPushService(IPushChannelFactory pushChannelFactory, WindowsPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new WindowsPushChannelFactory(), channelSettings, serviceSettings) { }
public WindowsPhonePushService(IPushChannelFactory pushChannelFactory, WindowsPhonePushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }