diff options
| author | Martin Ridgers <[email protected]> | 2021-10-25 10:11:29 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-10-25 10:11:29 +0200 |
| commit | e5e32e07a548a1fb956a858e51c332598a290253 (patch) | |
| tree | e6054271251d6178cc8edffc335355674aae6273 /zenhttp/httpnull.cpp | |
| parent | HttpAsioServer::Run() implementation for POSIX platforms (diff) | |
| download | zen-e5e32e07a548a1fb956a858e51c332598a290253.tar.xz zen-e5e32e07a548a1fb956a858e51c332598a290253.zip | |
Use m_ShutdownEvent.Wait() in HttpNullServer::Run() on POSIX
Diffstat (limited to 'zenhttp/httpnull.cpp')
| -rw-r--r-- | zenhttp/httpnull.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/zenhttp/httpnull.cpp b/zenhttp/httpnull.cpp index 4208421e1..1a60e211c 100644 --- a/zenhttp/httpnull.cpp +++ b/zenhttp/httpnull.cpp @@ -35,6 +35,12 @@ HttpNullServer::Run(bool IsInteractiveSession) { const bool TestMode = !IsInteractiveSession; + int WaitTimeout = -1; + if (!TestMode) + { + WaitTimeout = 1000; + } + #if ZEN_PLATFORM_WINDOWS if (TestMode == false) { @@ -43,13 +49,6 @@ HttpNullServer::Run(bool IsInteractiveSession) do { - int WaitTimeout = -1; - - if (!TestMode) - { - WaitTimeout = 1000; - } - if (!TestMode && _kbhit() != 0) { char c = (char)_getch(); @@ -70,7 +69,7 @@ HttpNullServer::Run(bool IsInteractiveSession) do { - zen::Sleep(1493); + m_ShutdownEvent.Wait(WaitTimeout); } while (!IsApplicationExitRequested()); #endif |