连接超时

发布于 2024-07-21 07:14:55 字数 68 浏览 3 评论 0原文

我正在尝试使用 c# 向服务器发送消息。 但是我收到套接字异常 10060,这意味着连接超时错误。 可能是什么问题呢?

Using c# I am trying to send messages to a server.
However I am getting the socket exception 10060 which means a connection time-out error.
What could be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

腹黑女流氓 2024-07-28 07:14:55

检查服务器上的应用程序是否已启动并正在运行。
仔细检查地址和端口。
检查您的防火墙是否允许您尝试建立的连接类型。

最简单的方法可能是使用 telnet 并查看是否可以连接。

Check that application on your server is up and running.
Double check address and port.
Check that your firewall allows connections of the type you are trying to make.

The simplest way would be probably to use telnet and see if you can connect.

挽袖吟 2024-07-28 07:14:55

可能是服务器未侦听指定端口或不接受连接。 这可能是由于防火墙(软件或硬件)造成的。

我将使用第三方应用程序测试与服务器的连接。 例如,只需 telnet 到给定端口上的主机(如果是 TCP 连接)并查看是否建立了连接。

在服务器上,您可以运行 netstat -na(在 Windows 上)来查看是否有任何内容正在侦听目标端口。

Could be that the server's not listening on the specified port or it's not accepting the connection. This could be because of a firewall (software or hardware).

I would test the connection to the server with a third-party app. For instance, just telnet to the host on the given port (if it's a TCP connection) and see if a connection is established.

On the server, you can run netstat -na (on windows) to see if there's anything listening on the destination port.

是你 2024-07-28 07:14:55

转到计算机并在本地使用 telnet:

telnet localhost yourportnumberhere

...如果您没有连接,请忘记防火墙 - 您只是没有侦听该端口。

如果有效,请从该计算机返回到其网络上的计算机,然后重试。 如果失败,则表明计算机上的防火墙阻止了它。

如果有效,则在您的计算机上使用相同的 telnet 命令(或者至少是运行尝试连接的代码的计算机)

Go to the machine and use telnet locally:

telnet localhost yourportnumberhere

...if you don't get a connection, forget about firewalls - you're just not listening on that port.

If it works, work your way back from the machine to one on it's network and try again. If that fails, it's the firewall on the machine that is blocking it.

If that works, then use the same telnet command on your machine (or at least the one running the code that is trying to connect)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文