正在显示
1 个修改的文件
包含
47 行增加
和
0 行删除
src/server/spserver/sphttp.hpp
0 → 100644
1 | +/* | |
2 | + * Copyright 2007 Stephen Liu | |
3 | + * For license terms, see the file COPYING along with this library. | |
4 | + */ | |
5 | + | |
6 | +#ifndef __sphttp_hpp__ | |
7 | +#define __sphttp_hpp__ | |
8 | + | |
9 | +#include "sphandler.hpp" | |
10 | +#include "spmsgdecoder.hpp" | |
11 | + | |
12 | +class SP_HttpRequest; | |
13 | +class SP_HttpResponse; | |
14 | +class SP_HttpMsgParser; | |
15 | + | |
16 | +class SP_HttpHandler { | |
17 | +public: | |
18 | + virtual ~SP_HttpHandler(); | |
19 | + | |
20 | + virtual void handle( SP_HttpRequest * request, SP_HttpResponse * response ) = 0; | |
21 | + | |
22 | + virtual void error(); | |
23 | + | |
24 | + virtual void timeout(); | |
25 | +}; | |
26 | + | |
27 | +class SP_HttpHandlerFactory { | |
28 | +public: | |
29 | + virtual ~SP_HttpHandlerFactory(); | |
30 | + | |
31 | + virtual SP_HttpHandler * create() const = 0; | |
32 | +}; | |
33 | + | |
34 | +class SP_HttpHandlerAdapterFactory : public SP_HandlerFactory { | |
35 | +public: | |
36 | + SP_HttpHandlerAdapterFactory( SP_HttpHandlerFactory * factory ); | |
37 | + | |
38 | + virtual ~SP_HttpHandlerAdapterFactory(); | |
39 | + | |
40 | + virtual SP_Handler * create() const; | |
41 | + | |
42 | +private: | |
43 | + SP_HttpHandlerFactory * mFactory; | |
44 | +}; | |
45 | + | |
46 | +#endif | |
47 | + | ... | ... |
请
注册
或
登录
后发表评论