From f78e50fe58cde6bff2411fa78c1d0cdfb2126c6d Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 9 Aug 2013 23:15:09 -0700 Subject: [PATCH] Add some business logic to MultiSocket --- .../sockets/ripple_MultiSocket.cpp | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/modules/ripple_asio/sockets/ripple_MultiSocket.cpp b/modules/ripple_asio/sockets/ripple_MultiSocket.cpp index de108d4c7..3dc5cc3b6 100644 --- a/modules/ripple_asio/sockets/ripple_MultiSocket.cpp +++ b/modules/ripple_asio/sockets/ripple_MultiSocket.cpp @@ -178,21 +178,43 @@ public: { } + //-------------------------------------------------------------------------- + enum { - timeoutSeconds = 3 + timeoutSeconds = 1 }; template - void testProtocol (Arg const& arg) + PeerTest::Results runProtocol (Arg const& arg) { - PeerTest::report_async , Arg> - (*this, timeoutSeconds, true); + return PeerTest::run , + TestPeerLogicAsyncServer, TestPeerLogicAsyncClient> (arg, timeoutSeconds); + } + + // Analyzes the results of the test based on the flags + // + void reportResults (int flags, PeerTest::Results const& results) + { + if ( (flags & MultiSocketDetails::client_ssl) != 0) + { + if ( ((flags & MultiSocketDetails::server_ssl) == 0) && + ((flags & MultiSocketDetails::server_ssl_required) == 0)) + { + } + } + else + { + } + + results.report (*this); } void testOptions (int flags) { - testProtocol (flags); + PeerTest::Results const results = runProtocol (flags); + + results.report (*this); } //--------------------------------------------------------------------------