简体   繁体   中英

udp (boost::asio) read error after async_receive_from

The handler sometimes gives an error after the remote UDP socket closes, the error is --> "No connection could be made because the target machine actively refused it".

My question is: isn't UDP connection-less ? does it care whatever on the remote side ?

btw, I got this on Windows 7.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM