it works ! thanks a lot.
 


------------------ Original ------------------
From:  "Gavin Lambert";<gavinl@compacsort.com>;
Date:  Tue, Aug 23, 2016 07:45 AM
To:  "boost-users"<boost-users@lists.boost.org>;
Subject:  Re: [Boost-users] Boost Asio SSL can't receive without sending

On 23/08/2016 01:52, Richard Hodges wrote:
> once io_service::run() returns, the io_service will be in the stopped()
> state. This happens when there are no remaining async operations waiting
> to complete on it. In a multi-threaded environment you must keep the
> io_service running by creating an io_service::work object against it.
> Then when you want to stop your communications loop, you would call
> op_service::stop() and join the threads.

Actually that's not strictly true.  As long as any operation or handler
is pending, the io_service won't stop on its own.  So if you ensure that
your async_read handler always starts another async_read (and if the
socket disconnects you immediately reconnect it), then you don't need
io_service::work; you only need that if there can be "dead times" when
no async operation is pending.

It's usually simpler to use it than not to, though.


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users