mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 00:15:51 +00:00
Use MultiSocket and strand in Peer
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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 ());
|
||||||
|
|||||||
Reference in New Issue
Block a user