aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpnull.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-15 15:58:15 +0200
committerMartin Ridgers <[email protected]>2021-10-15 16:00:47 +0200
commit291e7ef53894ccc620ee0e90131a790473d08eb4 (patch)
tree621173280efbfbdd5fb43fe4656a06522490e649 /zenhttp/httpnull.cpp
parentDisabled warning about missing initializers (diff)
downloadzen-291e7ef53894ccc620ee0e90131a790473d08eb4.tar.xz
zen-291e7ef53894ccc620ee0e90131a790473d08eb4.zip
A null httpd main loop for POSIX platforms
Diffstat (limited to 'zenhttp/httpnull.cpp')
-rw-r--r--zenhttp/httpnull.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/zenhttp/httpnull.cpp b/zenhttp/httpnull.cpp
index e49051ac5..4208421e1 100644
--- a/zenhttp/httpnull.cpp
+++ b/zenhttp/httpnull.cpp
@@ -2,9 +2,12 @@
#include "httpnull.h"
-#include <conio.h>
#include <zencore/logging.h>
+#if ZEN_PLATFORM_WINDOWS
+# include <conio.h>
+#endif
+
namespace zen {
HttpNullServer::HttpNullServer()
@@ -32,6 +35,7 @@ HttpNullServer::Run(bool IsInteractiveSession)
{
const bool TestMode = !IsInteractiveSession;
+#if ZEN_PLATFORM_WINDOWS
if (TestMode == false)
{
zen::logging::ConsoleLog().info("Zen Server running (null HTTP). Press ESC or Q to quit");
@@ -58,6 +62,18 @@ HttpNullServer::Run(bool IsInteractiveSession)
m_ShutdownEvent.Wait(WaitTimeout);
} while (!IsApplicationExitRequested());
+#else
+ if (TestMode == false)
+ {
+ zen::logging::ConsoleLog().info("Zen Server running (null HTTP). Ctrl-C to quit");
+ }
+
+ do
+ {
+ zen::Sleep(1493);
+ }
+ while (!IsApplicationExitRequested());
+#endif
}
void