id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3900,"Request for support of ""release"" member function or assign without ownership transfer to asio socket",artyomtnk@…,chris_kohlhoff,"boost::asio socket has assign member function allowing to transfer native socket to the asio socket. However, there is no option to release such handler or assign without ownership transfer. Please add one of these options. Rationale: null_buffer allow easy integration of 3rd part libraries to ASIO main loop for reactor style operations. However, today it is impossible to use it with 3rd part libraries that do not transfer on the socket ownership. Let's assume I have 3rd part library that gives me a file descriptor to put it in select loop for asynchronous operations. If I assign file descriptor to the socket, I would not be able to destroy socket object because it would close the connection. and I accidentally may close other valid socket. {{{ Thread A -------- foo f=foo_open() // fd=4 sock.assign(foo_native(f)); ... foo_close(f); // fd = 4 closed Thread B --------- some_fd = open() // some_fd = 4 Thread A -------- ~sock() /// fd=4 closed!!!! thread B can't work }}} Can you please provide one (or both) of the following APIs: {{{ // Transfer socket ownership to user and reset socket object. native_type release(); // Attach an existing native socket to the socket // (assign do not transfer ownership) void attach(const protocol_type & protocol, const native_type & native_socket); boost::system::error_code attach( const protocol_type & protocol, const native_type & native_socket, boost::system::error_code & ec); }}} ",Feature Requests,closed,To Be Determined,asio,Boost 1.42.0,Problem,fixed,,