ReactOS 0.4.15-dev-7674-gc0b4db1
CHttpDaemonThread Class Reference

#include <httpd.h>

Inheritance diagram for CHttpDaemonThread:
Collaboration diagram for CHttpDaemonThread:

Public Member Functions

 CHttpDaemonThread ()
 
virtual void Execute ()
 
- Public Member Functions inherited from CThread
 CThread ()
 
virtual ~CThread ()
 
BOOL PostMessage (UINT Msg, WPARAM wParam, LPARAM lParam)
 
virtual void Execute ()
 
virtual void Terminate ()
 
BOOL Terminated ()
 

Private Attributes

CHttpDaemonDaemon
 

Additional Inherited Members

- Protected Attributes inherited from CThread
BOOL bTerminated
 
DWORD dwThreadId
 
HANDLE hThread
 
ThreadData Data
 

Detailed Description

Definition at line 76 of file httpd.h.

Constructor & Destructor Documentation

◆ CHttpDaemonThread()

CHttpDaemonThread::CHttpDaemonThread ( )
inline

Definition at line 78 of file httpd.h.

78{};

Member Function Documentation

◆ Execute()

VOID CHttpDaemonThread::Execute ( )
virtual

Reimplemented from CThread.

Definition at line 449 of file httpd.cpp.

450{
451 MSG Msg;
452
453 try {
454 Daemon = NULL;
455 Daemon = new CHttpDaemon;
456
457 while (!Terminated()) {
459 if (PeekMessage(&Msg, 0, 0, 0, PM_REMOVE) != 0) {
460 switch (Msg.message) {
461 case HTTPD_START: {
462 if (Daemon->GetState() == hsStopped)
463 Daemon->Start();
464 break;
465 }
466 case HTTPD_STOP: {
467 if (Daemon->GetState() == hsRunning)
468 Daemon->Stop();
469 break;
470 }
471 case HTTPD_SUSPEND: {
472 if (Daemon->GetState() == hsRunning){}
473 // FIXME: Suspend service
474 break;
475 }
476 case HTTPD_RESUME: {
477 if (Daemon->GetState() != hsSuspended){}
478 // FIXME: Resume service
479 break;
480 }
481 default:
483 }
484 }
485 }
486 delete Daemon;
487 } catch (ESocket e) {
488 ReportErrorStr(e.what());
489 } catch (bad_alloc&) {
490 ReportErrorStr(TS("Insufficient resources."));
491 }
492}
CHttpDaemon * Daemon
Definition: httpd.h:81
virtual BOOL Stop()
Definition: httpd.cpp:417
virtual BOOL Start()
Definition: httpd.cpp:403
HTTPdState GetState() const
Definition: httpd.cpp:397
virtual VOID MessageLoop()
Definition: socket.cpp:251
BOOL Terminated()
Definition: thread.cpp:77
Definition: socket.h:32
struct @1628 Msg[]
#define NULL
Definition: types.h:112
void ReportErrorStr(LPTSTR lpsText)
Definition: error.cpp:13
#define HTTPD_SUSPEND
Definition: httpd.h:15
#define HTTPD_STOP
Definition: httpd.h:14
@ hsRunning
Definition: httpd.h:20
@ hsStopped
Definition: httpd.h:19
@ hsSuspended
Definition: httpd.h:21
#define HTTPD_START
Definition: httpd.h:13
#define HTTPD_RESUME
Definition: httpd.h:16
#define e
Definition: ke_i.h:82
#define TS(x)
Definition: error.h:11
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define PM_REMOVE
Definition: winuser.h:1195
#define PeekMessage
Definition: winuser.h:5829
#define DispatchMessage
Definition: winuser.h:5764

Member Data Documentation

◆ Daemon

CHttpDaemon* CHttpDaemonThread::Daemon
private

Definition at line 81 of file httpd.h.

Referenced by Execute().


The documentation for this class was generated from the following files: