Logo
~Sockets~
~Examples~
~Contact~


BaseSocket.h

Go to the documentation of this file.
00001 #ifndef _BASESOCKET_H
00002 #define _BASESOCKET_H
00003 
00004 #include <TcpSocket.h>
00005 
00006 
00007 typedef enum {
00008         M2S_OPEN = 0, // payload: host:port
00009         M2S_CLOSE,
00010         M2S_DATA, // payload: data
00011 //      M2S_PROXY_HEADER, // payload: http header to remote server
00012 //      M2S_PROXY_BODY, // payload: data
00013 //      M2S_PROXY_CONNECT, // payload: http proxy header w/ connection info
00014 } mastercmd_t;
00015 
00016 
00017 typedef enum {
00018         S2M_CONNECT = 0,
00019         S2M_DISCONNECTED,
00020         S2M_DATA,
00021 //      S2M_PROXY_HEADER,
00022 //      S2M_PROXY_DATA,
00023 //      S2M_PROXY_CONNECT,
00024 //      S2M_PROXY_CONNECT_FAILED,
00025 //      S2M_PROXY_CLOSE,
00026 } slavecmd_t;
00027 
00028 
00029 class BaseSocket : public TcpSocket
00030 {
00031 public:
00032         BaseSocket(ISocketHandler&);
00033         ~BaseSocket();
00034 
00035         void SendCmd(unsigned short id,mastercmd_t,short = 0);
00036         void SendCmd(unsigned short id,slavecmd_t,short = 0);
00037 
00038         void printmsg(unsigned short id,mastercmd_t,short len);
00039         void printmsg(unsigned short id,slavecmd_t,short len);
00040 
00041         std::string GetText(mastercmd_t);
00042         std::string GetText(slavecmd_t);
00043 
00044 protected:
00045         BaseSocket(const BaseSocket& s) : TcpSocket(s) {} // copy constructor
00046         BaseSocket& operator=(const BaseSocket& ) { return *this; } // assignment operator
00047 
00048 };
00049 
00050 
00051 
00052 
00053 #endif // _BASESOCKET_H
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4