c# - SignalR 与服务器的连接问题
问题描述
所以我最近买了一个vps来在我的项目中尝试SignalR,我用了这个例子:Simple SignalR Project
不幸的是,虽然我对此类事情没有任何经验,但我在我的 vps 上上传了 ServerSide 程序并尝试与之连接,但我收到以下错误: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)
所以我想知道我是否在这里做错了什么,或者需要在我的服务器上进行任何特定的设置/设置
顺便说一句,我的目标是与服务器建立连接并为我的项目获取实时数据,所以如果有更好的选择,不胜感激
解决方案
好吧,找到了解决方案,我的防火墙阻止了连接
推荐阅读
- javascript - 根据来自另一个对象的少数条件进行过滤
- dart - 如何将对象添加到 DART 中的现有类代码
- python - 在熊猫中查找下一个更高或更低的数字
- lambda-calculus - 我需要一些有关对 Lambda 演算表达式进行热切评估的步骤的帮助吗?
- python - 如何在python tkinter中将画布图像转换为字符串
- c# - 参数在 ActionResult 中没有给出正确的值
- spring-boot - 在原型 bean 中定义构造函数
- java - Spring @ExceptionHandler 没有覆盖默认响应
- swift - 集合视图中的搜索栏,从 Firestore 搜索
- prometheus - 无头运行时将蝗虫指标导出到普罗米修斯