来自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?
发布评论
评论(1)
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.