2 * NyLPC_cHttpdConnection.h
\r
4 * Created on: 2013/02/07
\r
8 #ifndef NYLPC_CHTTPDCONNECTION_H_
\r
9 #define NYLPC_CHTTPDCONNECTION_H_
\r
10 #include "NyLPC_stdlib.h"
\r
11 #include "NyLPC_uipService.h"
\r
12 #include "NyLPC_cHttpRequestPrefixParser.h"
\r
15 #define NyLPC_NyLPC_TcHttpdConnection_SIZE_OF_RX_BUF 512
\r
18 typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_Status;
\r
20 /** リクエストプレフィクスを読み出した状態*/
\r
21 #define NyLPC_cHttpdConnection_Status_IDLE 0
\r
23 #define NyLPC_cHttpdConnection_Status_CONNECTED 1
\r
24 /** コネクションはACCEPT済*/
\r
25 #define NyLPC_cHttpdConnection_Status_ACCEPTED 2
\r
26 /** リクエストプレフィクスを読み出した状態*/
\r
27 #define NyLPC_cHttpdConnection_Status_PREFETCH 3
\r
29 #define NyLPC_cHttpdConnection_Status_REQPARSED 4
\r
31 #define NyLPC_cHttpdConnection_Status_RESHEAD_SENT 5
\r
33 #define NyLPC_cHttpdConnection_Status_RESBODY_SENT 6
\r
37 typedef struct NyLPC_TcHttpdConnection NyLPC_TcHttpdConnection_t;
\r
38 struct NyLPC_TcHttpdConnection
\r
40 NyLPC_TUInt8 _status;
\r
41 NyLPC_TcTcpSocket_t _socket;
\r
42 NyLPC_TUInt8 _rxbuf[NyLPC_NyLPC_TcHttpdConnection_SIZE_OF_RX_BUF];
\r
43 NyLPC_TcHttpStream_t _in_stream;
\r
44 NyLPC_TcHttpRequestPrefixParser_t _pparser;
\r
46 void NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst);
\r
47 void NyLPC_cHttpdConnection_finalize(NyLPC_TcHttpdConnection_t* i_inst);
\r
51 * listenerでConnectionのソケットに接続を待ちます。
\r
53 NyLPC_TBool NyLPC_cHttpdConnection_listen(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcTcpListener_t* i_listener);
\r
55 * コネクションのソケットをacceptします。
\r
57 NyLPC_TBool NyLPC_cHttpdConnection_accept(NyLPC_TcHttpdConnection_t* i_inst);
\r
61 void NyLPC_cHttpdConnection_close(NyLPC_TcHttpdConnection_t* i_inst);
\r
69 #endif /* NYLPC_CHTTPDCONNECTION_H_ */
\r