00001 #ifndef __CHM_LLP_CLIENT_H__
00002 #define __CHM_LLP_CLIENT_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <CHM/CHMminimumInclude.h>
00024
00025 #ifndef __CHM_CLIENT_HANDLE_H__
00026 #define __CHM_CLIENT_HANDLE_H__
00027 typedef void* CHMclientHandle;
00028 #endif
00029
00030
00039 class CHMllpClient
00040 {
00041 public:
00043 CHMllpClient();
00044
00046 virtual ~CHMllpClient();
00047
00049 CHMclientHandle GetHandle() const { return Handle; }
00050
00051
00063 const char* HeaderBlock() const;
00064
00065
00073 void SetHeaderBlock(const char* Value);
00074
00075
00088 const char* TrailerBlock() const;
00089
00090
00098 void SetTrailerBlock(const char* Value);
00099
00100
00107 CHMboolean IsConnected() const;
00108
00109
00119 void StopMessageLoop();
00120
00121
00140 static void RunMessageLoop();
00141
00142
00161 const char* MakeMessagePrintable(const char* InputString, const char* NewLine, CHMint32 MaximumLength);
00162
00163
00177 void Connect(const char* Host, CHMint32 Port);
00178
00179
00200 void Disconnect();
00201
00202
00213 void HardDisconnect();
00214
00215
00233 void TransmitMessage(const char* Message);
00234
00235
00240 virtual void OnConnected()=0;
00241
00242
00247 virtual void OnClosed()=0;
00248
00249
00258 virtual void OnMessageReceived(const char* Message)=0;
00259
00260
00271 virtual void OnDataIgnored(const char* Data)=0;
00272
00273
00283 virtual void OnErrorReceived(const char* Description, CHMint32 Code)=0;
00284
00285
00286 private:
00287 CHMllpClient(const CHMllpClient& Orig);
00288 CHMllpClient& operator=(const CHMllpClient& Orig);
00289 static void setup();
00290 CHMclientHandle Handle;
00291 };
00292
00293 #endif // end of defensive include