Refactor beast::asio:

* New tools for completion handlers:
  - wrap_handler provides composed io_service execution guarantees.
  - bind_handler rebinds arguments to handlers.
  - shared_handler type-erases any completion handler.
  - buffer_sequence type-erases templated BufferSequences
  - abstract_socket replaces Socket
  - socket_wrapper replaces SocketWrapper
  - beast::asio placeholders to work with std::bind

* Removed obsolete classes and functions
  - AbstractHandler
  - ComposedAsyncOperation
  - SharedFunction
  - SharedHandler
  - SharedHandlerAllocator
  - SharedHandlerPtr
  - SharedHandlerType
  - SocketBase
  - SocketWrapperStrand
  - wrapHandler

* Refactored classes to use new tools
  - abstract_socket
  - socket_wrapper
  - HandshakeDetector
  - HttpClientType

* Miscellanous tidying
  - socket classes moved to beast::asio namespace
  - beast asio files provide their own namespace declaration.
  - Fix IsCallPossible conflicting template parameter name
  - Use <boost/get_pointer.hpp> for C++11 compatibility.
  - Remove extraneous include path from build environment.
This commit is contained in:
Vinnie Falco committed 2014-03-14 08:03:48 -07:00
1 parent 5478c540cb
commit 6546c30e17
88 files changed
+2709 -3378

No files matched your search

@@ -17,7 +17,10 @@
*/
//==============================================================================
TestPeerLogicAsyncServer::TestPeerLogicAsyncServer (Socket& socket)
namespace beast {
namespace asio {
TestPeerLogicAsyncServer::TestPeerLogicAsyncServer (abstract_socket& socket)
: TestPeerLogic (socket)
{
}
@@ -39,7 +42,7 @@ void TestPeerLogicAsyncServer::on_connect_async (error_code const& ec)
if (socket ().needs_handshake ())
{
socket ().async_handshake (Socket::server,
socket ().async_handshake (abstract_socket::server,
boost::bind (&TestPeerLogicAsyncServer::on_handshake, this,
boost::asio::placeholders::error));
}
@@ -90,7 +93,7 @@ void TestPeerLogicAsyncServer::on_write (error_code const& ec, std::size_t bytes
// on_shutdown will call finished ()
// we need another instance of ec so we can call on_shutdown()
error_code ec;
on_shutdown (socket ().shutdown (Socket::shutdown_receive, ec));
on_shutdown (socket ().shutdown (abstract_socket::shutdown_receive, ec));
}
}
@@ -102,7 +105,7 @@ void TestPeerLogicAsyncServer::on_shutdown (error_code const& ec)
{
if (socket ().needs_handshake ())
{
socket ().shutdown (Socket::shutdown_receive, error ());
socket ().shutdown (abstract_socket::shutdown_receive, error ());
}
if (success (socket ().close (error ())))
@@ -115,3 +118,7 @@ void TestPeerLogicAsyncServer::on_shutdown (error_code const& ec)
finished ();
}
}
}