According to boost documentation, when socket::close() is invoked, asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the boost::asio::error::operation_aborted error.
socket::cancel causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted error.
Is there some difference between them?
When I want to finish one socket connection, which one should I call such that their callback handler will be invoked with boost::asio::error::operation_aborted error?