Class Hierarchy   Class Index   Method Index  

CHMllpClient.h

00001 #ifndef __CHM_LLP_CLIENT_H__
00002 #define __CHM_LLP_CLIENT_H__
00003 
00012 #include <CHM/CHMminimumInclude.h>
00013 
00014 #ifndef __CHM_CLIENT_HANDLE_H__
00015 #define __CHM_CLIENT_HANDLE_H__
00016 typedef void* CHMclientHandle;
00017 #endif
00018 
00019 
00028 class CHMllpClient
00029 {
00030 public:
00032    CHMllpClient();
00033    CHMllpClient(const CHMllpClient& Orig);
00034    CHMllpClient(CHMclientHandle Handle);
00035    
00037    virtual ~CHMllpClient();
00038    
00040    CHMllpClient& operator=(const CHMllpClient& Orig);
00041    
00043    CHMclientHandle GetHandle() const { return Handle; }
00044    
00045    
00057    const char* HeaderBlock() const;
00058    
00059    
00067    void SetHeaderBlock(const char* Value);
00068    
00069    
00082    const char* TrailerBlock() const;
00083    
00084    
00092    void SetTrailerBlock(const char* Value);
00093    
00094    
00101    CHMboolean IsConnected() const;
00102    
00103    
00113    void StopMessageLoop();
00114    
00115    
00134    static void RunMessageLoop();
00135    
00136    
00155    const char* MakeMessagePrintable(const char* InputString, const char* NewLine, CHMint32 MaximumLength);
00156    
00157    
00171    void Connect(const char* Host, CHMint32 Port);
00172    
00173    
00194    void Disconnect();
00195    
00196    
00207    void HardDisconnect();
00208    
00209    
00227    void TransmitMessage(const char* Message);
00228    
00229    
00234    virtual void OnConnected()=0;
00235    
00236    
00241    virtual void OnClosed()=0;
00242    
00243    
00252    virtual void OnMessageReceived(const char* Message)=0;
00253    
00254    
00265    virtual void OnDataIgnored(const char* Data)=0;
00266    
00267    
00277    virtual void OnErrorReceived(const char* Description, CHMint32 Code)=0;
00278    
00279    
00280 private:
00281    CHMclientHandle Handle;
00282    static void setup();
00283 };
00284 
00285 #endif // end of defensive include