[ASIO] Clarification regarding socket release on Windows

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ASIO] Clarification regarding socket release on Windows

Boost - Dev mailing list
The documentation (boost 1.67) of asio::basic_stream_socket::release() has
the following remark:

*This function is unsupported on Windows versions prior to Windows 8.1, and
will fail with boost::asio::error::operation_not_supported on these

This is in accordance with the compiler warning I get when building my
project (from asio basic_socket.hpp), and the runtime behavior: the native
socket ownership is indeed retained by asio. For the IOCP backend!

If I add the BOOST_ASIO_DISABLE_IOCP define to the build I still get the
warning, but the release() appears to be working: the ownership is released
and I can do whatever I want with the socket.

My question: does the above comment apply only to the IOCP backend and I
can use release() with the reactive socket service? Or it just happens to
be working in my current setup but it's not guaranteed for others (or it
leaks resources, etc...)?


Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost