Pushing notifications from the web server to the winforms client application

I am looking for a solution for our Winforms application. I wonder if there is a technology that can trigger notifications to the .net Winforms client. I want it to be able to receive notifications from the php web server when starting the application.

I've already seen things like node.js, and some examples show how to send notifications to websites, but not to clients. And I do not know if these technologies can be used for what I want. Do any of you have any experience?

Thanks,

+4
source share
3 answers

You can use ASP.NET with SignalR .
The example on this site uses WPF, but you can do the same with WinForms.

Here is an overview of the SignalR signal.
It allows you to call methods from the server on the client and from the client on the server.
As you can see on these websites, SignalR was created mainly for web applications, but there is no problem using it for the standard Winforms client.

+1
source

SignalR is a good technology that can be used with ASP.Net server and clients such as JavaScript, WinForms and WPF.

Since your server code is written in PHP, SignalR cannot be integrated directly. Instead, you can configure a Windows server with IIS 8 or higher and deploy an intermediate ASP.Net website that acts as an intermediary between your PHP server and the WinForm client. The WinForm client will be connected to the ASP.Net server through SignalR and its transport protocol. You can send a notification to the ASP.Net site for HTTP requests, and the ASP.Net site will send a notification to connected clients.

0
source

This is exactly what reactive extensions (RX) were designed for. With RX, the client "subscribes" to "Subject", much like an event handler registers a listener. It supports almost any type and when the content is received, it is "downstream", which is signed by default; however, you can attach it to any other thread you want. Lee Campbell also wrote an excellent introduction to this topic.

http://www.introtorx.com/

0
source

Source: https://habr.com/ru/post/1434772/


All Articles