1 module hunt.http.server.Http1ServerTunnelConnection;
2 
3 import hunt.http.HttpVersion;
4 import hunt.http.HttpConnection;
5 import hunt.http.codec.http.stream.HttpTunnelConnection;
6 
7 import hunt.http.HttpConnection;
8 import hunt.net.secure.SecureSession;
9 import hunt.net.Connection;
10 // import hunt.net.buffer.FileRegion;
11 
12 import hunt.Functions;
13 import hunt.util.Common;
14 
15 import hunt.io.ByteBuffer;
16 import hunt.collection.Collection;
17 
18 /**
19  * 
20  */
21 class Http1ServerTunnelConnection : AbstractHttpConnection , HttpTunnelConnection {
22 
23     Action1!ByteBuffer content;
24 
25     this(Connection tcpSession, HttpVersion httpVersion) {
26         super(tcpSession, httpVersion);
27     }
28 
29     override
30     void write(ByteBuffer byteBuffer, Callback callback) {
31         _tcpSession.write(byteBuffer); // , callback
32     }
33 
34     // override
35     // void write(ByteBuffer[] buffers, Callback callback) {
36     //     tcpSession.write(buffers, callback);
37     // }
38 
39     // override
40     // void write(Collection!ByteBuffer buffers, Callback callback) {
41     //     tcpSession.write(buffers, callback);
42     // }
43 
44     // override
45     // void write(FileRegion file, Callback callback) {
46     //     tcpSession.write(file, callback);
47     // }
48 
49     override
50     void receive(Action1!ByteBuffer content) {
51         this.content = content;
52     }
53 
54     override
55     HttpConnectionType getConnectionType() {
56         return HttpConnectionType.HTTP_TUNNEL;
57     }
58 }