Use MultiSocket and strand in Peer

This commit is contained in:
Vinnie Falco
2013-08-28 12:19:25 -04:00
parent 8e75064fe3
commit 1277f70c47
3 changed files with 5 additions and 4 deletions

View File

@@ -163,7 +163,7 @@
// in Peer code if you suspect you're having problems because of it. // in Peer code if you suspect you're having problems because of it.
// //
#ifndef RIPPLE_PEER_USES_BEAST_MULTISOCKET #ifndef RIPPLE_PEER_USES_BEAST_MULTISOCKET
#define RIPPLE_PEER_USES_BEAST_MULTISOCKET 0 #define RIPPLE_PEER_USES_BEAST_MULTISOCKET 1
#endif #endif
// Here temporarily to turn off new Validations code while it // Here temporarily to turn off new Validations code while it

View File

@@ -34,7 +34,8 @@ public:
#if RIPPLE_PEER_USES_BEAST_MULTISOCKET #if RIPPLE_PEER_USES_BEAST_MULTISOCKET
ScopedPointer <MultiSocket> m_socket; ScopedPointer <MultiSocket> m_socket;
boost::asio::io_service& m_strand; //boost::asio::io_service& m_strand;
boost::asio::io_service::strand m_strand;
NativeSocketType& getNativeSocket () NativeSocketType& getNativeSocket ()
{ {

View File

@@ -598,7 +598,7 @@ protected:
Socket* new_ssl_stream () Socket* new_ssl_stream ()
{ {
typedef typename boost::asio::ssl::stream <next_layer_type&> SslStream; typedef typename boost::asio::ssl::stream <next_layer_type&> SslStream;
typedef SocketWrapperStrand <SslStream> Wrapper; typedef SocketWrapper <SslStream> Wrapper;
Wrapper* const socket = new Wrapper (m_next_layer, m_ssl_context); Wrapper* const socket = new Wrapper (m_next_layer, m_ssl_context);
set_ssl_stream (socket->this_layer ()); set_ssl_stream (socket->this_layer ());
return socket; return socket;
@@ -614,7 +614,7 @@ protected:
{ {
typedef boost::asio::ssl::stream < typedef boost::asio::ssl::stream <
PrefilledReadStream <next_layer_type&> > SslStream; PrefilledReadStream <next_layer_type&> > SslStream;
typedef SocketWrapperStrand <SslStream> Wrapper; typedef SocketWrapper <SslStream> Wrapper;
Wrapper* const socket = new Wrapper (m_next_layer, m_ssl_context); Wrapper* const socket = new Wrapper (m_next_layer, m_ssl_context);
socket->this_layer ().next_layer().fill (buffers); socket->this_layer ().next_layer().fill (buffers);
set_ssl_stream (socket->this_layer ()); set_ssl_stream (socket->this_layer ());