00001 #include "WOscConfig.h" 00002 00003 #ifndef __WOSC_TCP_CLIENT_H__ 00004 #define __WOSC_TCP_CLIENT_H__ 00005 00006 #if OS_IS_LINUX == 1 || OS_IS_MACOSX == 1 || OS_IS_CYGWIN == 1 00007 00008 #include "WOscTcpHandler.h" 00009 00010 /** 00011 * 00012 */ 00013 class WOscTcpClient: public WOscTcpHandler 00014 { 00015 public: 00016 WOscTcpClient(bool threading = true); 00017 virtual ~WOscTcpClient(); 00018 /** Try to open a connection to a remote server. 00019 * Establishes a connection to a remote server and creates a separate 00020 * thread for reception of server replies. 00021 */ 00022 Error Connect(const TheNetReturnAddress& serverAddress); 00023 Error Close(); 00024 protected: 00025 virtual void HandleOffendingPackets(const char* const data, int dataLen, 00026 const WOscException& exception) { } 00027 virtual void HandleNonmatchedMessages(const WOscMessage* msg, 00028 const WOscNetReturn* networkReturnAddress) { } 00029 }; 00030 00031 #else 00032 # warning "WOscTcpClient not supported on this platform" 00033 #endif 00034 00035 #endif // __WOSC_TCP_CLIENT_H__