diff options
| author | Stefan Boberg <[email protected]> | 2023-10-04 13:13:23 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-04 13:13:23 +0200 |
| commit | 3e8db7cd243e8be3b2d5fea2490b9ad70f765590 (patch) | |
| tree | c1533ae25b0b717dd2393960c5449aadd56807c4 /src/zenserver | |
| parent | factored out http parser from asio into separate files (#444) (diff) | |
| download | zen-3e8db7cd243e8be3b2d5fea2490b9ad70f765590.tar.xz zen-3e8db7cd243e8be3b2d5fea2490b9ad70f765590.zip | |
removed websocket protocol support(#445)
removed websocket support since it is not used right now and is unlikely to be used in the future
Diffstat (limited to 'src/zenserver')
| -rw-r--r-- | src/zenserver/config.cpp | 16 | ||||
| -rw-r--r-- | src/zenserver/config.h | 22 | ||||
| -rw-r--r-- | src/zenserver/zenserver.cpp | 22 |
3 files changed, 10 insertions, 50 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 5e24d174b..c0a97ce5b 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -796,8 +796,6 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("network.httpserverclass"sv, ServerOptions.HttpServerConfig.ServerClass, "http"sv); LuaOptions.AddOption("network.httpserverthreads"sv, ServerOptions.HttpServerConfig.ThreadCount, "http-threads"sv); LuaOptions.AddOption("network.port"sv, ServerOptions.BasePort, "port"sv); - LuaOptions.AddOption("network.websocket.port"sv, ServerOptions.WebSocketPort, "websocket-port"sv); - LuaOptions.AddOption("network.websocket.threadcount"sv, ServerOptions.WebSocketThreads, "websocket-threads"sv); LuaOptions.AddOption("network.httpsys.async.workthreads"sv, ServerOptions.HttpServerConfig.HttpSys.AsyncWorkThreadCount, @@ -1076,20 +1074,6 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) cxxopts::value<int>(ServerOptions.BasePort)->default_value("1337"), "<port number>"); - options.add_option("network", - "", - "websocket-port", - "Websocket server port", - cxxopts::value<int>(ServerOptions.WebSocketPort)->default_value("0"), - "<port number>"); - - options.add_option("network", - "", - "websocket-threads", - "Number of websocket I/O thread(s) (0 == hardware concurrency)", - cxxopts::value<int>(ServerOptions.WebSocketThreads)->default_value("0"), - ""); - options.add_option("httpsys", "", "httpsys-async-work-threads", diff --git a/src/zenserver/config.h b/src/zenserver/config.h index 924375a19..df1ccb752 100644 --- a/src/zenserver/config.h +++ b/src/zenserver/config.h @@ -134,18 +134,16 @@ struct ZenServerOptions ZenObjectStoreConfig ObjectStoreConfig; zen::HttpServerConfig HttpServerConfig; ZenStructuredCacheConfig StructuredCacheConfig; - std::filesystem::path DataDir; // Root directory for state (used for testing) - std::filesystem::path ContentDir; // Root directory for serving frontend content (experimental) - std::filesystem::path AbsLogFile; // Absolute path to main log file - std::filesystem::path ConfigFile; // Path to Lua config file - std::string ChildId; // Id assigned by parent process (used for lifetime management) - std::string LogId; // Id for tagging log output - std::string EncryptionKey; // 256 bit AES encryption key - std::string EncryptionIV; // 128 bit AES initialization vector - int BasePort = 1337; // Service listen port (used for both UDP and TCP) - int OwnerPid = 0; // Parent process id (zero for standalone) - int WebSocketPort = 0; // Web socket port (Zero = disabled) - int WebSocketThreads = 0; + std::filesystem::path DataDir; // Root directory for state (used for testing) + std::filesystem::path ContentDir; // Root directory for serving frontend content (experimental) + std::filesystem::path AbsLogFile; // Absolute path to main log file + std::filesystem::path ConfigFile; // Path to Lua config file + std::string ChildId; // Id assigned by parent process (used for lifetime management) + std::string LogId; // Id for tagging log output + std::string EncryptionKey; // 256 bit AES encryption key + std::string EncryptionIV; // 128 bit AES initialization vector + int BasePort = 1337; // Service listen port (used for both UDP and TCP) + int OwnerPid = 0; // Parent process id (zero for standalone) bool InstallService = false; // Flag used to initiate service install (temporary) bool UninstallService = false; // Flag used to initiate service uninstall (temporary) bool IsDebug = false; diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp index cf9f03d89..83eb81e3b 100644 --- a/src/zenserver/zenserver.cpp +++ b/src/zenserver/zenserver.cpp @@ -17,7 +17,6 @@ #include <zencore/trace.h> #include <zencore/workthreadpool.h> #include <zenhttp/httpserver.h> -#include <zenhttp/websocket.h> #include <zenstore/cidstore.h> #include <zenstore/scrubcontext.h> #include <zenutil/basicfile.h> @@ -309,15 +308,6 @@ public: m_Http = zen::CreateHttpServer(ServerOptions.HttpServerConfig); int EffectiveBasePort = m_Http->Initialize(ServerOptions.BasePort); - if (ServerOptions.WebSocketPort != 0) - { - const uint32_t ThreadCount = - ServerOptions.WebSocketThreads > 0 ? uint32_t(ServerOptions.WebSocketThreads) : std::thread::hardware_concurrency(); - - m_WebSocket = zen::WebSocketServer::Create( - {.Port = gsl::narrow<uint16_t>(ServerOptions.WebSocketPort), .ThreadCount = Max(ThreadCount, uint32_t(16))}); - } - // Setup authentication manager { std::string EncryptionKey = ServerOptions.EncryptionKey; @@ -396,11 +386,6 @@ public: #if ZEN_WITH_TESTS m_Http->RegisterService(m_TestingService); - - if (m_WebSocket) - { - m_WebSocket->RegisterService(m_TestingService); - } #endif if (m_HttpProjectService) @@ -526,11 +511,6 @@ public: OnReady(); - if (m_WebSocket) - { - m_WebSocket->Run(); - } - m_Http->Run(IsInteractiveMode); SetNewState(kShuttingDown); @@ -590,7 +570,6 @@ public: m_CidStore.reset(); m_AuthService.reset(); m_AuthMgr.reset(); - m_WebSocket.reset(); m_Http = {}; m_JobQueue.reset(); } @@ -788,7 +767,6 @@ private: } zen::Ref<zen::HttpServer> m_Http; - std::unique_ptr<zen::WebSocketServer> m_WebSocket; std::unique_ptr<zen::AuthMgr> m_AuthMgr; std::unique_ptr<zen::HttpAuthService> m_AuthService; zen::HttpStatusService m_StatusService; |