public WindowsPhoneNotificationService(IPushBroker pushBroker, ILogger logger, IWindowsPhoneServiceSettings settings) { PushBroker = pushBroker; Logger = logger; SetupPushSharpLogging(settings); Result = new OperationResult(false, string.Empty); }
public ServiceWorkerAdapter(IPushBroker <TNotification> broker, IPushConnection <INotification> connection) { Broker = broker; Connection = connection; CancelTokenSource = new CancellationTokenSource(); notifications = new BlockingCollection <TNotification>(); }
private void UdpServerForm_Load(object sender, EventArgs e) { //Port = DEFAULT_PORT; //var ip = IPAddress.Any; //Console.WriteLine("Starting echo server..."); //Console.WriteLine("Will begin listening for requests on {0}:{1}", ip, Port); //var bootstrapper = // new ServerBootstrap() // .WorkerThreads(2) // .SetTransport(TransportType.Udp); //var reactor = bootstrapper.NewReactor(NodeBuilder.BuildNode().Host(ip).WithPort(Port)); //reactor.OnConnection += (node, connection) => //{ // ServerPrint(node, // string.Format("Accepting connection from... {0}:{1}", node.Host, node.Port)); // connection.BeginReceive(Receive); //}; //reactor.OnDisconnection += (reason, address) => ServerPrint(address.RemoteHost, // string.Format("Closed connection to... {0}:{1} [Reason:{2}]", address.RemoteHost.Host, // address.RemoteHost.Port, reason.Type)); //reactor.Start(); IConnectionConfig connectionConfig = new DefaultConnectionConfig(); connectionConfig.SetOption(WebSocketParamEumns.Port.ToString(), 8088); var bootstrapper = new PushBootstrap() .SetPushType(PushTypeEumns.WebSocket) .WorkerThreads(2) .BuildPushServerFactory <WebSocketNotifications>(); IPushBroker <WebSocketNotifications> pushBroker = bootstrapper.NewPushBroker(connectionConfig) as IPushBroker <WebSocketNotifications>; pushBroker.OnConnection += PushBroker_OnNewConnection; pushBroker.Start(); }
public GoogleGcmNotificationService(IPushBroker pushBroker, ILogger logger, IGoogleServiceSettings settings) { PushBroker = pushBroker; _Settings = settings; Logger = logger; SetupPushSharpLogging(settings); Result = new OperationResult(false, string.Empty); }
public AppleNotificationService(IPushBroker pushBroker, ILogger logger, IAppleServiceSettings settings) { PushBroker = pushBroker; _Settings = settings; Logger = logger; SetupPushSharpLogging(settings); Result = new OperationResult(false, string.Empty); }
public WorkDocker(IPushBroker <TNotification> broker, IPushConnectionFactory connectionFactory) { PushBroker = broker; ConnectionFactory = connectionFactory; lockWorkers = new object(); workers = new List <ServiceWorkerAdapter <TNotification> >(); ScaleSize = 1; //AutoScale = true; //AutoScaleMaxSize = 20; }
public static void RegisterWindowsService(this IPushBroker broker, WindowsPushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null) { var service = new WindowsPushService(new WindowsPushChannelFactory(), channelSettings, serviceSettings); broker.RegisterService <WindowsRawNotification>(service, applicationId); broker.RegisterService <WindowsTileNotification>(service, applicationId); broker.RegisterService <WindowsToastNotification>(service, applicationId); broker.RegisterService <WindowsBadgeNumericNotification>(service, applicationId); broker.RegisterService <WindowsBadgeGlyphNotification>(service, applicationId); }
protected void UnHookEvents(IPushBroker pushBroker) { pushBroker.OnNotificationSent -= NotificationSent; pushBroker.OnChannelException -= ChannelException; pushBroker.OnServiceException -= ServiceException; pushBroker.OnNotificationFailed -= NotificationFailed; pushBroker.OnDeviceSubscriptionExpired -= DeviceSubscriptionExpired; pushBroker.OnDeviceSubscriptionChanged -= DeviceSubscriptionChanged; pushBroker.OnChannelCreated -= ChannelCreated; pushBroker.OnChannelDestroyed -= ChannelDestroyed; }
public static void RegisterWindowsPhoneService(this IPushBroker broker, WindowsPhonePushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null) { var service = new WindowsPhonePushService(new WindowsPhonePushChannelFactory(), channelSettings, serviceSettings); broker.RegisterService <WindowsPhoneCycleTileNotification>(service, applicationId); broker.RegisterService <WindowsPhoneFlipTileNotification>(service, applicationId); broker.RegisterService <WindowsPhoneIconicTileNotification>(service, applicationId); broker.RegisterService <WindowsPhoneTileNotification>(service, applicationId); broker.RegisterService <WindowsPhoneToastNotification>(service, applicationId); broker.RegisterService <WindowsPhoneRawNotification>(service, applicationId); }
public static void RegisterBlackberryService(this IPushBroker broker, BlackberryPushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null) { RegisterBlackberryService(broker, channelSettings, null, serviceSettings); }
public NotificationSender(IPushBroker broker) { this.broker = broker; this.channels = new Dictionary<Type, IPushChannel>(); }
public static WindowsBadgeGlyphNotification WindowsBadgeGlyphNotification(this IPushBroker broker) { return(new WindowsBadgeGlyphNotification()); }
public static void RegisterAdmService(this IPushBroker broker, AdmPushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null) { broker.RegisterService <AdmNotification>(new AdmPushService(new AdmPushChannelFactory(), channelSettings, serviceSettings)); }
public static GcmNotification GcmNotification(this IPushBroker broker) { return(new GcmNotification()); }
/// <summary> /// Create a new instance of the <see cref="FirefoxOSNotification"/> class. /// </summary> /// /// <param name="broker">Registration broker.</param> /// /// <returns>Created notification object.</returns> public static FirefoxOSNotification FirefoxOSNotification(this IPushBroker broker) { return(new FirefoxOSNotification()); }
/// <summary> /// Registers FirefoxOS service. /// </summary> /// /// <param name="broker">Registration broker.</param> public static void RegisterFirefoxOSService(this IPushBroker broker) { broker.RegisterService <FirefoxOSNotification>(new FirefoxOSPushService()); }
public static void RegisterWindowsPhoneService(this IPushBroker broker, string applicationId, IPushServiceSettings serviceSettings = null) { RegisterWindowsPhoneService(broker, null, applicationId, serviceSettings); }
public static WindowsPhoneRawNotification WindowsPhoneRawNotification(this IPushBroker broker) { return(new WindowsPhoneRawNotification()); }
public static void RegisterChromeGcmService(this IPushBroker broker, ChromePushChannelSettings channelSettings, string applicationId = null, IPushServiceSettings serviceSettings = null) { broker.RegisterService <ChromeNotification>(new ChromePushService(channelSettings, serviceSettings), applicationId); }
public static void RegisterWindowsService(this IPushBroker broker, WindowsPushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null) { RegisterWindowsService(broker, channelSettings, null, serviceSettings); }
public static void RegisterChromeGcmService(this IPushBroker broker, ChromePushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null) { RegisterChromeGcmService(broker, channelSettings, null, serviceSettings); }
public static WindowsToastNotification WindowsToastNotification(this IPushBroker broker) { return(new WindowsToastNotification()); }
public static BlackberryNotification BlackberryNotification(this IPushBroker broker) { return(new BlackberryNotification()); }
public static AdmNotification AdmNotification(this IPushBroker broker) { return(new AdmNotification()); }
public static void RegisterWindowsPhoneService(this IPushBroker broker, IPushServiceSettings serviceSettings = null) { RegisterWindowsPhoneService(broker, null, null, serviceSettings); }
public static ChromeNotification ChromeNotification(this IPushBroker broker) { return(new ChromeNotification()); }
public static void RegisterC2dmService(this IPushBroker broker, C2dmPushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null) { broker.RegisterService <C2dmNotification>(new C2dmPushService(channelSettings, serviceSettings), applicationId); }
public static C2dmNotification C2dmNotification(this IPushBroker broker) { return(new C2dmNotification()); }
public static void RegisterBlackberryService(this IPushBroker broker, BlackberryPushChannelSettings channelSettings, string applicationId = null, IPushServiceSettings serviceSettings = null) { broker.RegisterService <BlackberryNotification>(new BlackberryPushService(channelSettings, serviceSettings), applicationId); }