public ApplePushService(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { cancelTokenSource = new CancellationTokenSource(); feedbackService = new FeedbackService(); feedbackService.OnFeedbackReceived += new FeedbackService.FeedbackReceivedDelegate(feedbackService_OnFeedbackReceived); timerFeedback = new Timer(new TimerCallback((state) => { feedbackService.Run(channelSettings as ApplePushChannelSettings, this.cancelTokenSource.Token); //Timer will run first after 10 seconds, then every 10 minutes to get feedback! }),null, TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(10)); }
public PushChannelBase(PushChannelSettings channelSettings, PushServiceSettings serviceSettings) { this.stopping = false; //this.CancelTokenSource = new CancellationTokenSource(); //this.CancelToken = CancelTokenSource.Token; this.queuedNotifications = new Queue <Notification>(); this.ChannelSettings = channelSettings; this.ServiceSettings = serviceSettings ?? new PushServiceSettings(); //Start our sending task taskSender = new Thread(new ThreadStart(Sender)); taskSender.Start(); }
public PushChannelBase(PushChannelSettings settings) { this.stopping = false; this.CancelTokenSource = new CancellationTokenSource(); this.CancelToken = CancelTokenSource.Token; this.queuedNotifications = new ConcurrentQueue<Notification>(); this.Settings = settings; //Start our sending task taskSender = new Task(() => Sender(), TaskCreationOptions.LongRunning); taskSender.ContinueWith((t) => { var ex = t.Exception; }, TaskContinuationOptions.OnlyOnFaulted); taskSender.Start(); }
public PushChannelBase(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) { this.stopping = false; this.CancelTokenSource = new CancellationTokenSource(); this.CancelToken = CancelTokenSource.Token; this.queuedNotifications = new ConcurrentQueue <Notification>(); this.ChannelSettings = channelSettings; this.ServiceSettings = serviceSettings ?? new PushServiceSettings(); //Start our sending task taskSender = new Task(() => Sender(), TaskCreationOptions.LongRunning); taskSender.ContinueWith((t) => { var ex = t.Exception; }, TaskContinuationOptions.OnlyOnFaulted); taskSender.Start(); }
public PushChannelBase(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) { this.stopping = false; this.CancelTokenSource = new CancellationTokenSource(); this.CancelToken = CancelTokenSource.Token; this.queuedNotifications = new ConcurrentQueue<Notification>(); this.ChannelSettings = channelSettings; this.ServiceSettings = serviceSettings ?? new PushServiceSettings(); this.waitQueuedNotification = new ManualResetEventSlim(); //Start our sending task taskSender = new Task(Sender, TaskCreationOptions.LongRunning); taskSender.ContinueWith((t) => { var ex = t.Exception; }, TaskContinuationOptions.OnlyOnFaulted); taskSender.Start(); }
public ApplePushService(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { var appleChannelSettings = channelSettings as ApplePushChannelSettings; cancelTokenSource = new CancellationTokenSource(); feedbackService = new FeedbackService(); feedbackService.OnFeedbackReceived += new FeedbackService.FeedbackReceivedDelegate(feedbackService_OnFeedbackReceived); //allow control over feedback call interval, if set to zero, don't make feedback calls automatically if (appleChannelSettings.FeedbackIntervalMinutes > 0) { timerFeedback = new Timer(new TimerCallback((state) => { try { feedbackService.Run(channelSettings as ApplePushChannelSettings, this.cancelTokenSource.Token); } catch (Exception ex) { this.Events.RaiseChannelException(ex); } //Timer will run first after 10 seconds, then every 10 minutes to get feedback! }), null, TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(appleChannelSettings.FeedbackIntervalMinutes)); } }
public PushServiceBase(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) { this.ServiceSettings = serviceSettings ?? new PushServiceSettings(); this.ChannelSettings = channelSettings; this.queuedNotifications = new ConcurrentQueue<Notification>(); timerCheckScale = new Timer(new TimerCallback((state) => { CheckScale(); }), null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15)); CheckScale(); distributerTask = new Task(Distributer, TaskCreationOptions.LongRunning); distributerTask.ContinueWith((ft) => { var ex = ft.Exception; }, TaskContinuationOptions.OnlyOnFaulted); distributerTask.Start(); stopping = false; }
protected override PushChannelBase CreateChannel(PushChannelSettings channelSettings) { return(new WindowsPhonePushChannel(channelSettings as WindowsPhonePushChannelSettings)); }
protected override PushChannelBase CreateChannel(PushChannelSettings channelSettings) { return new AndroidPushChannel(channelSettings as AndroidPushChannelSettings); }
public PushChannelBase(PushChannelSettings channelSettings) : this(channelSettings, null) { }
protected override PushChannelBase CreateChannel(PushChannelSettings channelSettings) { return(new GcmPushChannel(channelSettings as GcmPushChannelSettings)); }
protected override PushChannelBase CreateChannel(PushChannelSettings channelSettings) { return new WindowsPhonePushChannel(channelSettings as WindowsPhonePushChannelSettings); }
public WindowsPhonePushService(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { }
protected abstract PushChannelBase CreateChannel(PushChannelSettings channelSettings);
public TestablePushService(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { }
public AndroidPushService(PushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { }
protected override PushChannelBase CreateChannel(PushChannelSettings channelSettings) { return new GcmPushChannel(channelSettings as GcmPushChannelSettings); }