如何将消息从 API 服务器 (PHP/rest) 推送到 C# 应用程序
我有 C# 应用程序从 PHP/MySQL API 服务器 (Rest/JSON) 请求数据。现在,我还需要在发生某些事件(从网站提交表单)时将消息推送到 C# 应用程序。我搜了一下,似乎COMET、长轮询和http流是选项。您能否就哪种技术在这里有意义提供一些建议,因为我不提倡使用网络浏览器?
此外,如果使用 HTTP 流(如 twitter 流 API),我是否需要保留一个 HTTP 连接表,以便我知道在推送目标事件(仅向某些 C# 客户端)时使用哪个连接?我有点困惑,非常感谢!
I have C# apps requesting data from PHP/MySQL API server (Rest/JSON). Now I also need to push messages to the C# apps when some events occur (form submission from the web site). I searched around, and it seems that COMET, long polling, and http streaming are options. Could you please provide some suggestions on which technology makes sense here, as I am not pushing to a web browser?
In addition, if using HTTP streaming (like twitter streaming API), do I need to keep a table of HTTP connections so I know which connection to use when pushing targeted events (only to certain C# clients)? I am a bit confused, and many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
制作 WCF Web 服务。 http://www.codeproject.com/KB/WCF/WCFWebService.aspx
使用 PHP 连接: http://weblogs.asp.net/gunnarpeipman/archive/2007/09/17/using-wcf-services-with-php.aspx
Make a WCF Web Service. http://www.codeproject.com/KB/WCF/WCFWebService.aspx
To connect using PHP: http://weblogs.asp.net/gunnarpeipman/archive/2007/09/17/using-wcf-services-with-php.aspx
在微服务环境中,您将来可能希望在更多不同的编码语言之间进行通信,这就是为什么在 Kaltura 中,我们使用描述性 XML 我们稍后可以使用 生成多种编码语言的客户端库,我们的代码生成器包括 C# 和 PHP 的客户端库。
我还发布了几个 REST 服务器示例,包括 C#。
In micro-services environment you might want to communicate between more different coding languages in the future, that's why in Kaltura we expose every API with descriptive XML that we can use later to generate client libraries in multiple coding languages, our code generator includes client libraries for C# and PHP.
I also published several REST server examples, including C#.