[asio] question on boost::asio::ssl::stream::async_shutdown expected behaviour

m_sslSocket.async_shutdown(boost::bind(&TestClient::handle_sslshutdown,
Hi guys, I've question on behaviour of boost::asio::ssl::stream::async_shutdown I would expect that this should behave as any other async method of ASIO: both in case of succeed or error it should call my handler on completion. At some point in my code I call: this, boost::asio::placeholders::error));
void TestClient::handle_sslshutdown(const boost::system::error_code& error) { std::cout << "SSL shutdown completed with error <"<<error.message()<<">\n"; socket_.lowest_layer().close(); std::cout << "Lower TCP layer closed\n"; }
But it's never called on successful shutdown, it's called only if the other peer previously yet closed the connection, thus resulting in an error. So my handler is called with relative error code; in positive case, my handler is never called. What am I missing? Something here in client code or something in the server code? Thanks in advance and best regards, Carlo Medas

Dear all, first of all, kindly please let me know if I'm sending messages in the wrong place. I've investigated more in-deep this issue and it seems that async_shutdown is producing a stack overflow. This has been tested with latest boost version. The result is the same if I try with Windows Xp (MSVC v8.0-express) and with a Linux RHEL 4 64bit. I've enclosed the linux coredump. Please let me know and thanks in advance. Kind regards, Carlo Medas On Fri, May 9, 2008 at 4:02 PM, Carlo Medas <carlomedas@gmail.com> wrote:
Hi guys,
I've question on behaviour of boost::asio::ssl::stream::async_shutdown I would expect that this should behave as any other async method of ASIO: both in case of succeed or error it should call my handler on completion.
At some point in my code I call:
m_sslSocket.async_shutdown(boost::bind(&TestClient::handle_sslshutdown, this, boost::asio::placeholders::error));
void TestClient::handle_sslshutdown(const boost::system::error_code& error) { std::cout << "SSL shutdown completed with error <"<<error.message()<<">\n"; socket_.lowest_layer().close(); std::cout << "Lower TCP layer closed\n"; }
But it's never called on successful shutdown, it's called only if the other peer previously yet closed the connection, thus resulting in an error. So my handler is called with relative error code; in positive case, my handler is never called.
What am I missing? Something here in client code or something in the server code?
Thanks in advance and best regards,
Carlo Medas

Carlo Medas wrote:
Dear all,
first of all, kindly please let me know if I'm sending messages in the wrong place.
I've investigated more in-deep this issue and it seems that async_shutdown is producing a stack overflow. This has been tested with latest boost version. The result is the same if I try with Windows Xp (MSVC v8.0-express) and with a Linux RHEL 4 64bit. I've enclosed the linux coredump.
Please let me know and thanks in advance.
I applied a fix for this a few weeks back. Can you please try the changes shown here: http://svn.boost.org/trac/boost/changeset/44668 Thanks. Cheers, Chris

Dear Chris, your fix works perfectly; thank you very much again for this powerful and portable network engine. Kind regards, \Carlo On Tue, May 13, 2008 at 10:28 AM, Christopher Kohlhoff <chris@kohlhoff.com> wrote:
Carlo Medas wrote:
Dear all,
first of all, kindly please let me know if I'm sending messages in the wrong place.
I've investigated more in-deep this issue and it seems that async_shutdown is producing a stack overflow. This has been tested with latest boost version. The result is the same if I try with Windows Xp (MSVC v8.0-express) and with a Linux RHEL 4 64bit. I've enclosed the linux coredump.
Please let me know and thanks in advance.
I applied a fix for this a few weeks back. Can you please try the changes shown here:
http://svn.boost.org/trac/boost/changeset/44668
Thanks.
Cheers, Chris
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Carlo Medas
-
Christopher Kohlhoff