SignalR - 一个SignalR服务器的MVC应用程序 [英] SignalR - MVC app to a SignalR server

查看:70
本文介绍了SignalR - 一个SignalR服务器的MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



这可能听起来像是一个奇怪的/愚蠢的,但我需要完成以下任务:



我有一个在域上运行和托管的SignalR服务。我还在一个单独的域上托管了一个MVC应用程序。我现在需要两个人互相交谈。我可以轻松地在WPF应用程序和SignalR服务之间生成通信,但我遇到了MVC应用程序的问题,因为我希望在它们之间进行通信。基本上,我想在MVC应用程序中控制器级别的通信,而不是通过视图或javascript文件,如我找到的所有示例。在某种程度上,我想编写它类似于你为WPF应用程序所做的。



我的问题是:

1 - 是否有可能使用SignalR(MVC控制器级别< - >服务而不是Javascript< - >服务)构建这样的通信?

2 - 如果是这样,有人可以指点我正确的方向去实现这个?



提前致谢!

nortee

解决方案
尴尬!!!我使用了错误的集线器名称。一旦将其更改为正确的集线器名称,它就会开始正确连接......:|


Hi all,

This is probably going to sound like a strange/stupid, but I need to accomplish the following:

I have a SignalR service running and hosted on a domain. I also have an MVC application hosted on a separate domain. I now need the two to talk to each other. I can easily generate comms between a WPF app and the SignalR service, but I am having issues with the MVC app because of the way I want to do my comms between them. Basically, I want to have the comms at the controller level in in the MVC app and not via the views or javascript files like all the examples I have found. In a way, I would like to code it similar to what you do for the WPF application.

My questions are:
1 - Is it possible to build the comms like this with SignalR (MVC Controller Level <-> Service and not Javascript <-> Service)?
2 - If so, can someone please point me in the correct direction to go about implementing this?

Thanks in advance!
nortee

解决方案

Embarrasing!!! I used the wrong hub name. Once this was changed to the correct hub name it began connecting properly... :|


这篇关于SignalR - 一个SignalR服务器的MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆