1

处理程序有时会在远程 UDP 套接字关闭后给出错误,错误是 --> “无法建立连接,因为目标机器主动拒绝了它”。

我的问题是:不是 UDP connection-less 吗?它关心远程端的任何东西吗?

顺便说一句,我在 Windows 7 上得到了这个。

4

1 回答 1

3

UDP is a connectionless protocol.

The confusing error message is the result of asio having to provide portable errors. Some context is loss when having to go from platform specific errors to portable errors. In this case, asio receives ERROR_PORT_UNREACHABLE and maps it to boost::asio::error::connection_refused.

于 2012-06-06T16:20:01.063 回答