RCFProto

- Main Page
- Classes
- Files

- File List

All Classes Functions Typedefs
HttpConnectFilter.hpp
1
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18
19 #ifndef INCLUDE_RCF_HTTPCONNECTFILTER_HPP
20 #define INCLUDE_RCF_HTTPCONNECTFILTER_HPP
21
22 #include <boost/shared_ptr.hpp>
23
24 #include <RCF/Filter.hpp>
25 #include <RCF/ByteBuffer.hpp>
26
27 namespace RCF {
28
29 class HttpConnectFilter : public Filter
30 {
31 public:
32
33 HttpConnectFilter();
34 HttpConnectFilter(const std::string serverAddr, int serverPort);
35
36 void resetState();
37
38 void read(
39 const ByteBuffer &byteBuffer,
40 std::size_t bytesRequested);
41
42 void write(const std::vector<ByteBuffer> &byteBuffers);
43
44 void onReadCompleted(const ByteBuffer &byteBuffer);
45
46 void onWriteCompleted(std::size_t bytesTransferred);
47
48 int getFilterId() const;
49
50 private:
51
52 std::string mServerAddr;
53 int mServerPort;
54
55 bool mPassThrough;
56
57 std::vector<ByteBuffer> mOrigWriteBuffers;
58
59 std::string mHttpConnectRequest;
60 std::string mHttpConnectResponse;
61
62 std::size_t mWritePos;
63 std::size_t mReadPos;
64
65 std::vector<char> mReadVector;
66 };
67
68 } // namespace RCF
69
70 #endif // ! INCLUDE_RCF_HTTPCONNECTFILTER_HPP