diff options
Diffstat (limited to 'lib/server/ServerStream.h')
-rw-r--r-- | lib/server/ServerStream.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/server/ServerStream.h b/lib/server/ServerStream.h index 8dafccae..745c3ccb 100644 --- a/lib/server/ServerStream.h +++ b/lib/server/ServerStream.h @@ -56,6 +56,10 @@ public: return "generic-stream-server"; } + #ifdef WIN32 + virtual void OnIdle() { } + #endif + virtual void Run() { // Set process title as appropraite @@ -215,6 +219,7 @@ public: if(connection.get()) { // Since this is a template parameter, the if() will be optimised out by the compiler + #ifndef WIN32 // no fork on Win32 if(ForkToHandleRequests) { pid_t pid = ::fork(); @@ -255,14 +260,20 @@ public: } else { + #endif // !WIN32 // Just handle in this connection SetProcessTitle("handling"); HandleConnection(*connection); SetProcessTitle("idle"); + #ifndef WIN32 } + #endif // !WIN32 } } - + + #ifdef WIN32 + OnIdle(); + #else // !WIN32 // Clean up child processes (if forking daemon) if(ForkToHandleRequests) { @@ -277,6 +288,7 @@ public: } } while(p > 0); } + #endif // !WIN32 } } catch(...) @@ -301,7 +313,11 @@ protected: // depends on the forking model in case someone changes it later. bool WillForkToHandleRequests() { + #ifdef WIN32 + return false; + #else return ForkToHandleRequests; + #endif // WIN32 } private: |