WP7's background agent - how to run longer & how to communicate with? [closed] - api

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm trying to implement a socket listener in Windows Phone 7.1, which should process the incoming data and make some actions based on it (constantly, without interrupting). As far as I've found this, the info described there confused a lot, so these are the questions:
Is there some ability for the background agent to be run constantly, without interrupting by the system (or with acceptable amount of running time, more than 10 minutes)?
Is there any API to communicate with running agent, something like Android's AIDL?
PS. I cannot use Push Notifications.

No, background agents cannot run constantly. If you need code to execute constantly then you should keep the app running, maybe enable running under lock screen if appropriate.
No, you cannot connect to an agent.
Agents are not like services.

Your sockets requirement sounds like you will run into the same problem presented by this question: Windows Phone 7 (Mango) App gets disconnected when put in background?
PeriodTask is only executed every 30 minutes or so and thus cannot maintain a socket connection. You might want to look into running under the lock screen, as per Matt's answer, or perhaps ResourceIntensiveTask which can run for as long as you want for 10 minutes but only while the phone is connected to power and the phone has > 90% battery.
There is no API to communicate between the two but applications and their tasks share isolated storage, including databases.

Related

Is there any alternative for Azure Logic apps? opensource would be better [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Currently I'm using Azure Logic apps to sync the changes to different 3rd parties.
But it's too expensive when there are massive requests/messages.
The key features:
MQ connector, which can be used as trigger.
HTTP processor, used to issue HTTP requests.
Parse json response.
Possibility to check the history.
I've done some research of Apache Nifi.
My feeling is it's not very user friendly and quite old school.
One close open source option that I know of is n8n.
But you could also explore the fixed pricing model (Integration Service Environment) that logic apps offer, which is charged by the hour instead of based on the volume coming. Depending on the volume fluctuations, you can scale up more units as required.
Also, a completely new (in preview currently) way to develop and run logic app workflows was announced, which introduces a new pricing model (same as app service or premium plan of functions).
This is introduces a docker-based deployment which allows running your logic apps anywhere too.
Apache NiFi can be used for your requirements.
Apache NiFi is an easy to use, powerful, and reliable system to process and distribute data.
It has:
ConsumeMQTT processor which subscribes to a topic and receives messages from an MQTT broker.
InvokeHTTP processor which can interact with a configurable HTTP Endpoint.
Numerous json processors.
Data Provenance feature which tracks dataflow from beginning to end.

Communicate between 2 applications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have written a basic VB winform application (in visual studio) that control the lights. I published and create an install package so I can install this on other PCs.
My questions is how to sync these applications to communicate with one another so if I turn a light on, on one PC, other PC will sense that and display it on thier application.
I can use timer to see if there are any action every 15 second, but I don’t think this is efficient way.
Take a look at this question that involves sending information between computers over a network. You could have the program send what it did to the lights so that the other programs can update themselves.
I'd suggest you look at writing the status to a file accessible to all on the network, use the filewatcher class to detect changes to the file, and when the file changes read it from all PCs to see the current status of everything.
ref: https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx
another option would be to use UDP broadcasting

Why thread is required [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am new to a desktop application and seeing that there are threads used everywhere.
I don't understand why we are using it here and not in webapplications.
We can directly call the method instead of threads.
'Threads used everywhere' is probably an ominous sign of problems to come and possibly past incompetence, but the main reason people use multiple threads in desktop applications is to allow long-running things to happen without freezing the user-interface of the application.
A conventional Windows GUI app has a 'main thread' which is responsible for processing messages received from the OS. These messages are used for all mouse/keyboard interaction, so the moment you stop processing them, the application stops responding (after a few seconds of this, Windows itself will grey-out the app and put 'stopped responding' in the title bar.)
To avoid this ugliness, people move activities which take a long time (either because they need a lot of CPU, or because the may be waiting for I/O (disk, network, etc)) onto other threads. This means that the main thread is free to keep pumping messages.
You do not start the main thread explicitly - Windows gives it to you when the app starts.
You need to be very careful about interaction between background threads and the main thread - there are a bunch of rules and restrictions, and failing to follow them will give you the kind of problems which may not show up immediately, consistently or on your machine at all. That doesn't mean they're not there...

Is Windows RT tablet able to receive push messages while it is in sleep mode [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
IPad is able to receive push messages while it has screen turned off.
Is it possible to receive push messages with WinRT device in sleep mode?
I would guess it is not possible with Intel based pro models...
Note. This is quite important issue when planning for Windows RT applications. Chat application could be made if somekind of alert could be given to user. Pro models can run real Windows Desktop apps, which can alert user when running at backround...
based on this whitepaper http://www.microsoft.com/en-us/download/details.aspx?id=30703 and what i have read before, there is a connected standby..
the whitepaper talks about background tasks working as should. no mention of notifications per say but i'd imagine they should be work as well. Apps however will be in suspended state at that point

Best way to monitor uptime of a remote windows server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
The company I work with currently has 10 windows boxes running various in house scripts, however occasionally one goes down and no one notices for periods of up to 24 hours because the data that is manufactured is only gathered on weekly intervals. Does anyone know of a management system that will notify when a box goes down and possibly shoot uptime and response statistics back to a web management system on a linux box?
There are many.
I use Nagios for monitoring Windows and Linux servers. You might also look into Zenoss. Both are open source.
http://www.pingdom.com/ is simple to use and you get a 30 day trial - 9.95 a month gets you a lot if you decide to sign on. have it for all my apps
I would have a bash script call ping on the machines and email me (or whomever is responsible) when a box goes down.
I've seen IPMonitor in use, and it is a very good tool (but expensive). Nagios is a free alternative, and it's supposed to be quite good, but I've never used it myself.
I know nmap has a way of showing you the machine's uptime when you use the OS fingerprinting option.