简体   繁体   English

从远程服务器向.NET应用程序发送信号

[英]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). 我有一个.NET应用程序,它将PHP GET和POST请求发送到我的服务器(在AWS EC-2实例上)。

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. 当然,您可以使用signalR,signalR可以像网站一样托管,当您的客户端启动时,可以连接到该signalR网站。 SiganlR should be hosted separately from your server application. SiganlR应该与服务器应用程序分开托管。

Let say A,B client and your Server application got connected to signalR. 假设A,B客户端和您的Server应用程序已连接到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. 现在,当A使用post方法对您的PHP服务器进行修改时,PHP服务器可以在signalR中调用一个方法,然后signalR可以向所有连接的客户端广播消息。 You can use group concept in signalR to target specific audience. 您可以在signalR中使用组概念来定位特定的受众。

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从远程服务器自动更新asp.net Web应用程序 - Auto update asp.net web application from remote server 托管在另一台计算机上的Web应用程序可以在不将数据发送到服务器的情况下从本地.NET应用程序接收数据吗? - Can a web application hosted on another machine receive data from a local .NET application without sending data to the server? 如何从部署在另一台服务器上的MVC4.net应用程序调用部署在远程服务器上的Servicestack服务? - How To Call Servicestack service deployed on remote server from MVC4.net application deployed on another server? 在asp.net中发送电子邮件时无法连接到远程服务器 - Unable to connect to remote server while sending email in asp.net 从VS2010调试在远程IIS服务器上运行的ASP.NET应用程序 - Debug ASP.NET application running on remote IIS Server from VS2010 在asp.net中的服务器上托管后,从Web应用程序发送邮件时发生错误 - Error occurred while sending mail from web application after hosting on server in asp.net 通过具有自签名SSL证书的邮件服务器从.net应用程序发送电子邮件 - Sending email from a .net application via a mail server with a self-signed SSL certificate 从同一服务器上的Windows服务发送在ASP.NET MVC应用程序中运行的SignalR Broadcast - Sending SignalR Broadcasts that is running within ASP.NET MVC Application from a Windows Service on the same server 从 ASP.NET 应用程序发送邮件 - Sending mail from ASP.NET application 将ArrayList从服务器发送到客户端应用程序 - Sending an ArrayList from a Server to a Client Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM