/* * IXSocketFactory.cpp * Author: Benjamin Sergeant * Copyright (c) 2019 Machine Zone, Inc. All rights reserved. */ #include "IXSocketFactory.h" #if defined(__APPLE__) or defined(__linux__) # ifdef __APPLE__ # include # else # include # endif #endif namespace ix { std::shared_ptr createSocket(bool tls, std::string& errorMsg) { errorMsg.clear(); if (!tls) { return std::make_shared(); } else { #ifdef IXWEBSOCKET_USE_TLS # ifdef __APPLE__ return std::make_shared(); # else return std::make_shared(); # endif #else errorMsg = "TLS support is not enabled on this platform."; return nullptr; #endif } } }