10
|
1 module dreactor.protocol.Http11;
|
|
2
|
|
3 import dreactor.protocol.RawTcp;
|
|
4 import dreactor.protocol.http11_parser;
|
|
5
|
|
6 class HttpListener
|
|
7 {
|
|
8 public
|
|
9 this(Vat sel, IPv4Address addr)
|
|
10 {
|
|
11 listener = new RawTCPListener(sel, IPv4Address addr);
|
|
12 parser = new Http11Parser();
|
|
13 listener.setDataHandler(&onData);
|
|
14 }
|
|
15
|
|
16 private int onData(char[] buffer)
|
|
17 {
|
|
18 parser.execute(buffer);
|
|
19 }
|
0
|
20
|
10
|
21
|
|
22 private
|
|
23 RawTCPListener listener;
|
|
24 Http11Parser parser;
|
|
25 }
|
|
26
|
|
27 class HttpClient
|
0
|
28 {
|
10
|
29 public
|
|
30 this(Vat sel)
|
|
31 {
|
|
32 client = new RawTCPClient(sel);
|
|
33 client.setDataHandler(&onData);
|
|
34 }
|
|
35
|
|
36 private int onData()
|
|
37 {
|
|
38
|
|
39 }
|
|
40 private
|
|
41 RawTCPClient client;
|
0
|
42 }
|
10
|
43
|