summaryrefslogtreecommitdiffhomepage
path: root/NetEx/HttpServletExec.h
blob: ed89d1b5cfa1ab375ab5facca783c3a1db4478bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*  Starshatter: The Open Source Project
    Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
    Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
    Copyright (c) 1997-2006, Destroyer Studios LLC.

     AUTHOR:       John DiCamillo


     OVERVIEW
     ========
     Network Server Pump for HTTP Server
*/


#ifndef HttpServletExec_h
#define HttpServletExec_h

#include "HttpServer.h"

// +-------------------------------------------------------------------+

class HttpServlet;
class HttpSession;

// +-------------------------------------------------------------------+

class HttpServletExec : public HttpServer
{
public:
    static const char* TYPENAME() { return "HttpServletExec"; }

    HttpServletExec(WORD port, int poolsize=1);
    virtual ~HttpServletExec();

    int operator == (const HttpServletExec& l) const { return addr == l.addr; }

    virtual bool         DoGet(HttpRequest& request,  HttpResponse& response);

    virtual HttpServlet* GetServlet(HttpRequest& request);
    virtual HttpSession* GetSession(HttpRequest& request);

    virtual DWORD        CheckSessions();

    virtual int          GetSessionTimeout()  const { return session_timeout; }
    virtual void         SetSessionTimeout(int t)   { session_timeout = t;    }

protected:
    virtual void         DoSyncedCheck();

    List<HttpSession>    sessions;
    int                  session_timeout;
    HANDLE               hsession;
    bool                 exec_shutdown;
};

#endif  // HttpServletExec_h