src/server/daemon/sessionhandler.h

changeset 35
4417619a9bbd
parent 19
d680536f8c2f
child 41
bb7a1f5a8b48
equal deleted inserted replaced
34:2b4574e617c0 35:4417619a9bbd
29 #ifndef SESSIONHANDLER_H 29 #ifndef SESSIONHANDLER_H
30 #define SESSIONHANDLER_H 30 #define SESSIONHANDLER_H
31 31
32 #include "../util/thrpool.h" 32 #include "../util/thrpool.h"
33 #include "../public/nsapi.h" 33 #include "../public/nsapi.h"
34 #include "event.h"
34 35
35 #ifdef __cplusplus 36 #ifdef __cplusplus
36 extern "C" { 37 extern "C" {
37 #endif 38 #endif
38 39
52 }; 53 };
53 54
54 /* 55 /*
55 * BasicSessionHandler 56 * BasicSessionHandler
56 * 57 *
57 * The BasicSessionHandler enqueues the connections to a threadpool. IO and 58 * The BasicSessionHandler enqueues the connections to a threadpool. IO is
58 * request processing is handled by one thread. 59 * handled by the threadpool.
59 */ 60 */
60 typedef struct _basic_session_handler { 61 typedef struct _basic_session_handler {
61 SessionHandler sh; 62 SessionHandler sh;
62 threadpool_t *threadpool; 63 threadpool_t *threadpool;
63 64
64 } BasicSessionHandler; 65 } BasicSessionHandler;
66
67 /*
68 * EventSessionHandler
69 *
70 * The EventSessionHandler uses a event handler to handle request inputs.
71 */
72 typedef struct _event_session_handler {
73 SessionHandler sh;
74 event_handler_t *eventhandler;
75 } EventSessionHandler;
76
77 /*
78 * EventHttpIO
79 *
80 * defined in sesionhandler.c
81 */
65 82
66 83
67 SessionHandler* create_basic_session_handler(); 84 SessionHandler* create_basic_session_handler();
68 85
69 void basic_enq_conn(SessionHandler *handler, Connection *conn); 86 void basic_enq_conn(SessionHandler *handler, Connection *conn);
70 87
71 void* basic_run_session(void *data); 88 void* basic_run_session(void *data);
72 89
73 90
91 SessionHandler* create_event_session_handler();
92
93 void evt_enq_conn(SessionHandler *handler, Connection *conn);
94
95 void evt_request_input(event_handler_t *h, event_t *event);
96
74 97
75 #ifdef __cplusplus 98 #ifdef __cplusplus
76 } 99 }
77 #endif 100 #endif
78 101

mercurial