与服务器的信号连接问题



所以我最近买了一个vps来尝试SignalR在我的项目中,我用了这个例子:简单的SignalR项目

不幸的是,虽然我没有这样的事情的任何经验,我上传了我的vps服务器端程序,并试图与它连接,但我得到以下错误:An error occurred while sending the request.更详细:

System.Net.Http.HttpRequestException' in mscorlib.dll
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ip:9080
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) / System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ip:9080
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

所以我想知道我是否在这里做错了什么,或者需要在我的服务器上做任何特定的设置/设置

顺便说一下,我的目标是与服务器连接并为我的项目获取实时数据,所以如果有更好的替代方案,将非常感谢建议

好吧,我找到了解决方案,我的防火墙阻止连接

最新更新