aboutsummaryrefslogtreecommitdiff
path: root/zenhttp
diff options
context:
space:
mode:
Diffstat (limited to 'zenhttp')
-rw-r--r--zenhttp/httpasio.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp
index ea84e7e87..061cd607a 100644
--- a/zenhttp/httpasio.cpp
+++ b/zenhttp/httpasio.cpp
@@ -9,7 +9,9 @@
#include <memory_resource>
ZEN_THIRD_PARTY_INCLUDES_START
-#include <conio.h>
+#if ZEN_PLATFORM_WINDOWS
+# include <conio.h>
+#endif
#include <http_parser.h>
#include <asio.hpp>
ZEN_THIRD_PARTY_INCLUDES_END
@@ -1157,6 +1159,13 @@ HttpAsioServer::Run(bool IsInteractive)
{
const bool TestMode = !IsInteractive;
+ int WaitTimeout = -1;
+ if (!TestMode)
+ {
+ WaitTimeout = 1000;
+ }
+
+#if ZEN_PLATFORM_WINDOWS
if (TestMode == false)
{
zen::logging::ConsoleLog().info("Zen Server running (asio HTTP). Press ESC or Q to quit");
@@ -1164,13 +1173,6 @@ HttpAsioServer::Run(bool IsInteractive)
do
{
- int WaitTimeout = -1;
-
- if (!TestMode)
- {
- WaitTimeout = 1000;
- }
-
if (!TestMode && _kbhit() != 0)
{
char c = (char)_getch();
@@ -1183,6 +1185,18 @@ HttpAsioServer::Run(bool IsInteractive)
m_ShutdownEvent.Wait(WaitTimeout);
} while (!IsApplicationExitRequested());
+#else
+ if (TestMode == false)
+ {
+ zen::logging::ConsoleLog().info("Zen Server running (asio HTTP). Ctrl-C to quit");
+ }
+
+ do
+ {
+ m_ShutdownEvent.Wait(WaitTimeout);
+ }
+ while (!IsApplicationExitRequested());
+#endif
}
void