Best methods for implementing push services from Azure to Windows Service - windows-services

I have a Windows Service that will be constantly waiting for a notification to do work.
All I can find in MSDN is how to set up push notifications for Store apps and mobile devices.
Is there a technology that would allow pushing to a Windows Service from Azure? The Windows Service will be running on Windows 7.

Using push services is not the greatest idea. Its really just meant for mobile and Win* store apps.
Look into using Azure Service Bus.
You could set up a queue and your windows service would just listen to that queue, and when it finds a message relevant to it, it will process it.

Related

Job and device/shadow running at same time on the device

As we know the device can only run one single connection by same client id, based on that. A physical device opens a connection with the device implementation to subscribe to the AWS IoT Shadow. I was wondering how it that will work based on the jobs implementation seems to create another new MQTT client
You use the same connection you already have for your device to use jobs. Jobs are used through publish and subscribe to specific topics. You can read more about jobs MQTT API here: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution

Communication between asp.net app and a serviceworker, via signalR?

I'm new to serviceworkers and I wonder how could I connect my serviceworker to my asp.net application. My js client already is communicated with a service worker and it's able to show notifications.
However, I've seen that some webs (e.g facebook) send notifications even the browser's tab ins't opened (not inactive, not opened). I use signalR to communicate my app with the server. Would it be possible to communicate the serviceworker with the server? It would require to add signalR code to the serviceworker if I'm not wrong, but I don't think it's possible. I've seen that google has another way of communication, Google Cloud Communication
I can't use that, so any ideas of how could I solve this problem?
To make use of offline notifications (i.e., your browser is open but your page isn't), the browser itself needs to know about a messaging service that it can respond to, and which would let it know to wake up your service worker and give it a notification. These services are hard-coded into the browser. In Chrome's case, the service is GCM. And I believe Firefox is rolling out something of its own. You cannot wake up your service worker yourself from your server without going through one of these messaging services.
Remember that generally your service worker is asleep. The browser only wakes it up in response to specific events, and, if your pages are closed, there is no way to trigger a service worker event from your server, unless the browser provides a messaging service such as GCM.

Windows Service With NotifyIcon

I have to develop a TCP/IP server application that will entertain remote mobile clients to connect on some port and interact with each other. My plan is to build it as a windows service so that it may be managed on system level.
Windows Service
will start automatically listening to port and taking their requirements. A notify icon would be keep showing in system tray. If we will click on this notify icon, a form will be shown with current number of connected clients etc.
I have developed the code and tested it very well it works. But it doesn't show the Form.
Below is the code that starts service from Program.Main()
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service1()
};
ServiceBase.Run(ServicesToRun);
Am i Missing something?

Local Notification when remote server is unavailable

I know that iOS only allows a few background-modes, so is it possible to ping a website when the app is in the background, then use a local notification to alert the user that the server is now unavailable?
I'm able to ping the site, but I'm unsure about the background notifications.
I am using BackgroundFetch in with a remote server where I update some information for the application or push a local notification if the server is unavailable. It is good to use the available types of refresh rates for BGfetch and not set exact time interval, the app will adapt to the users needs and check the server at appropriate intervals that preserves the battery.
Some good resources:
http://code.tutsplus.com/tutorials/ios-7-sdk-background-transfer-service--mobile-20595
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:performFetchWithCompletionHandler:
While technically possible it isn't really a good idea. This is a mobile device, so there are many reasons why it wouldn't be able to connect to the server, and it also has limited battery life and potentially limits to the amount of network traffic it can use.
What you describe is much better handled by a server with a fast and reliable connection to the net and which uses push notifications to alert users to the outage.

Create an iOS App that runs as Web Server in background

I want to make an iOS application (for iPad specifically), which behave like a web server.
I saw the examples coming with COCOAHTTPSERVER, but i didn't understand something.
Is it possible for my application, while being in background, to receive a request from another application running in the same device?
If it is possible how can i do this?
Otherwise, if it is impossible, what is the meaning of a web server application, that can't work in background?
My exact problem is as follows: I need an iOS application that can receive a request from a javascript application, running on safari, in the same device. Can i create an application behaving like a web server in background (because safari must be in foreground), or there is another way to implement this?
You can run a web server in the background on iOS but unfortunately only for a limited time (up to 10 minutes max) and the OS can stop it at any time. See this tech note [1] for more info.
If that limitation is acceptable to you, you should use an already existing web server like GCDWebServer which handles background mode for you [2].
[1] https://developer.apple.com/library/ios/technotes/tn2277/_index.html
[2] https://github.com/swisspol/GCDWebServer#gcdwebserver--background-mode-for-ios-apps
This library may make your task much easier.
https://github.com/swisspol/GCDWebServer
No, iOS does not support web servers running in the background.
The reason Apple does this is that a web server has to listen for inbound network requests. Listening for inbound network requests requires that the radios be active all the time. Active radios drain the battery.

Resources