Boost logo

Boost :

From: Carlo Medas (carlomedas_at_[hidden])
Date: 2008-05-09 10:02:22


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk