source: cheroxy/trunk/include/CRXProxy.h@ 45

Last change on this file since 45 was 45, checked in by cheese, 11 years ago

#1 change access modifier of filter and http messages

File size: 1.5 KB
RevLine 
[18]1/**
2 * CRXProxy.h
3 */
4#ifndef __CRXPROXY_H__
5#define __CRXPROXY_H__
6
7#include "CRXException.h"
[24]8#include "CRXSocket.h"
9#include "CRXHttpMessage.h"
10#include "CRXHttpRequest.h"
11#include "CRXHttpResponse.h"
[28]12#include "CRXFilter.h"
[18]13
[24]14#define ERROR_PROXY -10000
15#define ERROR_PROXY_FAILED_TO_RECEIVE_REQUEST ERROR_PROXY - 1
16#define ERROR_PROXY_FAILED_TO_SEND_REQUEST ERROR_PROXY - 2
17#define ERROR_PROXY_FAILED_TO_RECEIVE_RESPONSE ERROR_PROXY - 3
18#define ERROR_PROXY_FAILED_TO_SEND_RESPONSE ERROR_PROXY - 4
19#define ERROR_PROXY_FAILED_TO_CONNECT_TO_SERVER ERROR_PROXY - 5
[28]20#define ERROR_PROXY_FAILED_TO_SET_RESPONSE ERROR_PROXY - 6
[45]21#define ERROR_PROXY_FAILED_TO_ACCEPT_CLIENT ERROR_PROXY - 7
[18]22
[24]23
[18]24class CRXProxy : public CRXException
25{
26private:
[20]27 CRXSocket mClient;
[24]28 CRXSocket mServer;
[18]29
[36]30 int mServerTimeout;
31
[24]32 CRXHttpRequest mHttpRequest;
33 CRXHttpResponse mHttpResponse;
34
[28]35 static CRXFilter mFilter;
[24]36
[18]37public:
[45]38 CRXProxy (const int aSocket);
[24]39 ~CRXProxy (void);
[18]40
41public:
[28]42 /* common utilities */
[36]43 void SetServerTimeout (const int aTimeout = TCPSOCKET_NO_TIMEOUT);
[24]44 void Close (void);
45
[28]46public:
47 /* for communication */
[24]48 int Forward (void);
49
[36]50 int ReceiveRequest (void);
51 int SendRequest (void);
52
53 int ReceiveResponse (void);
54 int SendResponse (void);
55
56public:
57 /* HTTP data */
[45]58 CRXFilter & GetFilter (void) const;
59 CRXHttpRequest & GetHttpRequest (void);
60 CRXHttpResponse & GetHttpResponse (void);
[18]61};
62
63#endif // #ifndef __CRXPROXY_H__
Note: See TracBrowser for help on using the repository browser.