2 #ifndef NYLPC_CHTTPD_H_
\r
3 #define NYLPC_CHTTPD_H_
\r
5 #include "NyLPC_stdlib.h"
\r
6 #include "../NyLPC_cNetConfig.h"
\r
7 #include "NyLPC_cHttpdThread.h"
\r
11 #endif /* __cplusplus */
\r
16 #ifndef NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD
\r
17 # define NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD 3
\r
21 * 持続性接続を許可するコネクションの数
\r
22 * NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD-1以下にしてください。
\r
24 #ifndef NyLPC_cHttpd_MAX_PERSISTENT_CONNECTION
\r
25 # define NyLPC_cHttpd_MAX_PERSISTENT_CONNECTION (NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD-1)
\r
32 #ifndef DEFINE_NyLPC_TcHttpdConnection_t
\r
33 typedef struct NyLPC_TcHttpdConnection NyLPC_TcHttpdConnection_t;
\r
34 #define DEFINE_NyLPC_TcHttpdConnection_t
\r
41 typedef void (*NyLPC_TcHttpd_onRequest)(NyLPC_TcHttpdConnection_t* i_inst);
\r
46 #ifndef DEFINE_NyLPC_TcHttpd_t
\r
47 typedef struct NyLPC_TcHttpd NyLPC_TcHttpd_t;
\r
48 #define DEFINE_NyLPC_TcHttpd_t
\r
50 struct NyLPC_TcHttpd
\r
53 NyLPC_TcHttpd_onRequest onRequest;
\r
55 NyLPC_TcMutex_t _mutex;
\r
56 NyLPC_TcTcpListener_t _listener;
\r
57 NyLPC_TcHttpdThread_t _thread[NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD];
\r
58 NyLPC_TInt16 _num_of_active_connection;
\r
64 void NyLPC_cHttpd_initialize(NyLPC_TcHttpd_t* i_inst,NyLPC_TUInt16 i_port_number);
\r
65 void NyLPC_cHttpd_finalize(NyLPC_TcHttpd_t* i_inst);
\r
66 void NyLPC_cHttpd_loop(NyLPC_TcHttpd_t* i_inst);
\r
67 void NyLPC_cHttpd_lock(NyLPC_TcHttpd_t* i_inst);
\r
68 void NyLPC_cHttpd_unlock(NyLPC_TcHttpd_t* i_inst);
\r
73 #endif /* __cplusplus */
\r
75 #endif /* NYLPC_CHTTPD_H_ */
\r