Windows中拒绝TCP连接的不同错误代码

发布于 2025-02-07 00:01:52 字数 310 浏览 2 评论 0 原文

来自MSDN:

error_connection_refused
1225(0x4c9)
远程计算机拒绝网络连接。

wsaeconnrefused
10061
连接拒绝。
无法建立连接,因为目标计算机积极拒绝它。这通常是由于试图连接到外国主机不活动的服务而引起的,也就是说,没有服务器应用程序运行。

这两个错误代码之间有什么区别?

在哪种情况下,我们会得到前者,在哪种情况下,我们得到了后者?

From MSDN:

ERROR_CONNECTION_REFUSED
1225 (0x4C9)
The remote computer refused the network connection.

WSAECONNREFUSED
10061
Connection refused.
No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running.

What are the differences between these 2 error codes?

In which situations do we get the former, and in which situations do we get the latter?

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

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

发布评论

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

评论(1

爱,才寂寞 2025-02-14 00:01:52

wsa*代码由和error_connection_refused是常规系统错误代码可以通过任何API函数返回。总的来说,他们的意思是同一件事。

WSA* codes are returned by Winsock library functions and ERROR_CONNECTION_REFUSED is a general system error code which could be returned by any API function. In general they mean the same thing.

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