[英]Problems to connect to a SignalR Self-Hosted in a Windows Service
我一直在嘗試連接到本教程中創建的Windows服務:
http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host
問題是我確實可以使用其自己的客戶端連接到它。 但是,我嘗試從控制台應用程序連接到它,但沒有成功。 此外,如果將SignalR Hub托管在控制台應用程序中,則可以成功連接到它。
我得到的錯誤是我的客戶端版本與服務器不兼容,並且連接被拒絕。
這是我嘗試連接的樣子:
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();
更新:
-錯誤消息:
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。
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.