Re: [asio-users] basic_socket::close() - all scheduled operations are cancelled immediately?
Brought to you by:
chris_kohlhoff
From: Alejandro S. <al...@gm...> - 2006-09-14 02:33:33
|
The correct definition should be "as soon as possible" or "any time soon". Christopher might enlight you in the correct direction. Here was some discussion about the subject: http://sourceforge.net/mailarchive/forum.php?thread_id=29777152&forum_id=42787 It isn't simple to enforce the end of all asyncronous calls. The close is also more or less asynchronous, since this library is calles ASIO =) Cheers, Alejandro. On 9/13/06, Christopher Collins <sq...@ho...> wrote: > Hello, > > I am a bit confused about some behavior I'm seeing. > > basic_socket::close() does not appear to be doing what I expected based on > my interpretation of the documentation. The documentation states that > "...Any asynchronous send, receive or connect operations will be cancelled > immediately, and will complete with the > boost::asio::error::operation_aborted error," but it appears that a read > handler associated with the socket is still getting called later on in a > different callstack. > > Have I misinterpretted the documentation? Is there a way to guarantee that > it is safe to delete an object whose member function was bound as a read > handler? My program is segfaulting, and from analysis and log files I am > quite certain that it is due to the handler being called after the object > has been deleted (I delete the object immediately after closing the socket). > > Some insight would be greatly appreciated. > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > |