diff --git a/Builds/VisualStudio2012/beast.vcxproj b/Builds/VisualStudio2012/beast.vcxproj
index cdc39ec66..a66eabb50 100644
--- a/Builds/VisualStudio2012/beast.vcxproj
+++ b/Builds/VisualStudio2012/beast.vcxproj
@@ -75,7 +75,7 @@
-
+
@@ -279,6 +279,12 @@
+
+ true
+ true
+ true
+ true
+
true
diff --git a/Builds/VisualStudio2012/beast.vcxproj.filters b/Builds/VisualStudio2012/beast.vcxproj.filters
index a2c09e430..c443c1bd3 100644
--- a/Builds/VisualStudio2012/beast.vcxproj.filters
+++ b/Builds/VisualStudio2012/beast.vcxproj.filters
@@ -752,9 +752,6 @@
beast_asio\sockets
-
- beast_asio\sockets
-
beast_asio\sockets
@@ -770,6 +767,9 @@
beast_asio\system
+
+ beast_asio\sockets
+
@@ -1189,6 +1189,9 @@
beast_asio
+
+ beast_asio\sockets
+
diff --git a/modules/beast_asio/beast_asio.cpp b/modules/beast_asio/beast_asio.cpp
index d0855e1a8..b9e45eae6 100644
--- a/modules/beast_asio/beast_asio.cpp
+++ b/modules/beast_asio/beast_asio.cpp
@@ -24,4 +24,6 @@
namespace beast
{
+#include "sockets/beast_SslContext.cpp"
+
}
diff --git a/modules/beast_asio/beast_asio.h b/modules/beast_asio/beast_asio.h
index 930cb4268..12646080c 100644
--- a/modules/beast_asio/beast_asio.h
+++ b/modules/beast_asio/beast_asio.h
@@ -51,9 +51,9 @@ namespace beast
#include "sockets/beast_SocketBase.h"
#include "sockets/beast_Socket.h"
#include "sockets/beast_SocketInterface.h"
-#include "sockets/beast_SocketWrapperBase.h"
#include "sockets/beast_SocketWrapper.h"
#include "sockets/beast_SharedSocket.h"
+#include "sockets/beast_SslContext.h"
}
diff --git a/modules/beast_asio/sockets/beast_SocketInterface.h b/modules/beast_asio/sockets/beast_SocketInterface.h
index c32040848..947ae8e50 100644
--- a/modules/beast_asio/sockets/beast_SocketInterface.h
+++ b/modules/beast_asio/sockets/beast_SocketInterface.h
@@ -34,7 +34,7 @@ struct SocketInterface
struct SyncStream { };
struct AsyncStream { };
struct Stream : SyncStream, AsyncStream { };
-
+
/** Tags for compatibility with asio::ssl::stream
http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream.html
*/
@@ -43,6 +43,82 @@ struct SocketInterface
struct AsyncHandshake { };
struct AsyncBufferedHandshake : AsyncHandshake{ };
struct Handshake : SyncBufferedHandshake, AsyncBufferedHandshake { };
+
+protected:
+ //--------------------------------------------------------------------------
+
+ /** Template specialization to determine available interfaces. */
+ template
+ struct InterfacesOf
+ {
+ /** Intrusive tag support.
+
+ To use this, add a struct called SocketInterfaces to your
+ class and derive it from the interfaces that you support.
+ For example:
+
+ @code
+
+ struct MyHandshakingStream
+ {
+ struct SocketInterfaces
+ : SocketInterface::Stream
+ , SocketInterface::Handshake
+ {
+ };
+ }
+
+ @endcode
+ */
+ typedef typename Object::SocketInterfaces type;
+ typedef type value;
+ };
+
+ // Specialization for boost::asio::basic_socket
+ template
+ struct InterfacesOf >
+ {
+ struct value : SocketInterface::Socket { };
+ typedef value type;
+ };
+
+ // Specialization for boost::asio::basic_stream_socket
+ template
+ struct InterfacesOf >
+ {
+ struct value : SocketInterface::Socket, SocketInterface::Stream { };
+ typedef value type;
+ };
+
+ // Specialization for boost::asio::ssl::stream
+ template
+ struct InterfacesOf >
+ {
+ struct value : SocketInterface::Stream , SocketInterface::Handshake { };
+ typedef value type;
+ };
+
+#if 1
+ // Less elegant, but works.
+ // Determines if Object supports the specified Interface
+ template
+ struct HasInterface : boost::false_type { };
+
+ template
+ struct HasInterface