简体   繁体   中英

Sending signals from a remote server to a .NET application

I have a .NET application which sends PHP GET and POST requests to my server (on an AWS EC-2 instance).

I now have a need for the local application to know in real-time when an event on the server happens. Basically two "accounts" are linked and they need to synchronize, so when one makes a change on the server, then the server must send a signal to the other to update it's "view".

I'm aware that I could achieve this by constantly querying to server to check for changes, but that seems horrendous.

Could someone please point in the right direction here?

Thanks!

Certainly you could use signalR, signalR can be hosted like website, when your client starts it can connect to this signalR website. SiganlR should be hosted separately from your server application.

Let say A,B client and your Server application got connected to signalR. Now when A modifies something using post method to your PHP server, PHP server then can invoke a method in signalR , then signalR can broadcast message to all the clients connected. You can use group concept in signalR to target specific audience.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM