Hook up AsyncSocket with WebSocket

This commit is contained in:
Alex Hultman
2018-10-30 03:26:43 +01:00
parent f2e2b7107a
commit 57255c874d
4 changed files with 24 additions and 7 deletions
+6
View File
@@ -28,6 +28,7 @@ namespace uWS {
template <bool SSL>
struct AsyncSocket : StaticDispatch<SSL> {
template <bool> friend struct HttpContext;
template <bool> friend struct WebSocketContext;
protected:
using SOCKET_TYPE = typename StaticDispatch<SSL>::SOCKET_TYPE;
using StaticDispatch<SSL>::static_dispatch;
@@ -40,8 +41,13 @@ protected:
);
}
// we need a type safe realType = getData<MiddleType>
/* Get socket extension */
void *getExt() {
// we might have multiple inheritance so need to know the middle type
return static_dispatch(us_ssl_socket_ext, us_socket_ext)((SOCKET_TYPE *) this);
}