![]() |
BaseSocket Class Reference#include <BaseSocket.h>
Inheritance diagram for BaseSocket: ![]()
Detailed Description
Definition at line 29 of file BaseSocket.h. Constructor & Destructor Documentation
Member Function Documentation
Definition at line 19 of file BaseSocket.cpp. References GetText(). 00020 { 00021 char buffer[6]; 00022 printf(">Send Id %5u Command %s Length %d\n", id, GetText(cmd).c_str(), len); 00023 unsigned short l = htons(id); 00024 memcpy(buffer, &l, 2); 00025 short s = htons(cmd); 00026 memcpy(buffer + 2, &s, 2); 00027 s = htons(len); 00028 memcpy(buffer + 4, &s, 2); 00029 SendBuf(buffer, 6); 00030 }
Definition at line 33 of file BaseSocket.cpp. References GetText(). 00034 { 00035 char buffer[6]; 00036 printf(">Send Id %5u Command %s Length %d\n", id, GetText(cmd).c_str(), len); 00037 unsigned short l = htons(id); 00038 memcpy(buffer, &l, 2); 00039 short s = htons(cmd); 00040 memcpy(buffer + 2, &s, 2); 00041 s = htons(len); 00042 memcpy(buffer + 4, &s, 2); 00043 SendBuf(buffer, 6); 00044 }
Definition at line 47 of file BaseSocket.cpp. References GetText(). Referenced by SlaveSocket::OnRead(), and MasterSocket::OnRead(). 00048 { 00049 printf("<Recv Id %5u Command %s Length %d\n", id, GetText(cmd).c_str(), len); 00050 }
Definition at line 53 of file BaseSocket.cpp. References GetText(). 00054 { 00055 printf("<Recv Id %5u Command %s Length %d\n", id, GetText(cmd).c_str(), len); 00056 }
Definition at line 59 of file BaseSocket.cpp. References M2S_CLOSE, M2S_DATA, and M2S_OPEN. Referenced by printmsg(), and SendCmd(). 00060 { 00061 switch (cmd) 00062 { 00063 case M2S_OPEN: // payload: host:port 00064 return "M2S_OPEN " + Utility::l2string(cmd); 00065 case M2S_CLOSE: 00066 return "M2S_CLOSE " + Utility::l2string(cmd); 00067 case M2S_DATA: // payload: data 00068 return "M2S_DATA " + Utility::l2string(cmd); 00069 /* 00070 case M2S_PROXY_HEADER: // payload: http header to remote server 00071 return "M2S_PROXY_HEADER " + Utility::l2string(cmd); 00072 case M2S_PROXY_BODY: // payload: data 00073 return "M2S_PROXY_BODY " + Utility::l2string(cmd); 00074 case M2S_PROXY_CONNECT: // payload: http proxy header w/ connection info 00075 return "M2S_PROXY_CONNECT" + Utility::l2string(cmd); 00076 */ 00077 } 00078 return "M2S_BAD COMMAND " + Utility::l2string(cmd); 00079 }
Definition at line 82 of file BaseSocket.cpp. References S2M_CONNECT, S2M_DATA, and S2M_DISCONNECTED. 00083 { 00084 switch (cmd) 00085 { 00086 case S2M_CONNECT: 00087 return "S2M_CONNECT " + Utility::l2string(cmd); 00088 case S2M_DISCONNECTED: 00089 return "S2M_DISCONNECTED " + Utility::l2string(cmd); 00090 case S2M_DATA: 00091 return "S2M_DATA " + Utility::l2string(cmd); 00092 /* 00093 case S2M_PROXY_HEADER: 00094 return "S2M_PROXY_HEADER " + Utility::l2string(cmd); 00095 case S2M_PROXY_DATA: 00096 return "S2M_PROXY_DATA " + Utility::l2string(cmd); 00097 case S2M_PROXY_CONNECT: 00098 return "S2M_PROXY_CONNECT" + Utility::l2string(cmd); 00099 case S2M_PROXY_CONNECT_FAILED: 00100 return "S2M_PROXY_CONNECT_FAILED" + Utility::l2string(cmd); 00101 case S2M_PROXY_CLOSE: 00102 return "S2M_PROXY_CLOSE " + Utility::l2string(cmd); 00103 */ 00104 } 00105 return "S2M_BAD COMMAND " + Utility::l2string(cmd); 00106 }
The documentation for this class was generated from the following files: |