简体   繁体   English

连接到Windows服务中自托管的SignalR的问题

[英]Problems to connect to a SignalR Self-Hosted in a Windows Service

I have been trying to connect to the Windows Service created in this tutorial: 我一直在尝试连接到本教程中创建的Windows服务:

http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host

The thing is that I do can connect to it using its own client. 问题是我确实可以使用其自己的客户端连接到它。 However, I've tried to connect to it from a console application and haven't had success. 但是,我尝试从控制台应用程序连接到它,但没有成功。 Moreover, if I host the SignalR Hub in a console application I can connect to it successfully. 此外,如果将SignalR Hub托管在控制台应用程序中,则可以成功连接到它。

The errors that I got say that my client version isn't compatible with the server and that the connection was refused. 我得到的错误是我的客户端版本与服务器不兼容,并且连接被拒绝。

This is how my attempt to connect looks like: 这是我尝试连接的样子:

 IHubProxy _hub;
 string url = @"http://localhost:8080/";
 var connection = new HubConnection(url);
 _hub = connection.CreateHubProxy("MyHub");
 _hub.On("addMessage", x => ShowMessage(x));
 connection.Start().Wait();

UPDATE: 更新:

-Errors Messages: -错误消息:

1. 1。

Exception:Caught: "You are using a version of the client that isn't compatible with the server. Client version 1.4, server version 1.3." (System.InvalidOperationException)
A System.InvalidOperationException was caught: "You are using a version of the client that isn't compatible with the server. Client version 1.4, server version 1.3."
Time: 2/20/2015 12:03:36 PM
Thread:Worker Thread[5924]

2. 2。

Exception:Thrown: "No connection could be made because the target machine actively refused it" (System.Net.Sockets.SocketException)
A System.Net.Sockets.SocketException was thrown: "No connection could be made because the target machine actively refused it"
Time: 2/20/2015 12:03:36 PM
Thread:Worker Thread[3320]

正如Christophe所指出的,这个问题是SignalR Java客户端的完全重复, 仅支持1.3 ,在我的情况下,通过卸载并重新安装所有SignalR / Owin软件包来解决。

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

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