00001 /* **************************************************************** 00002 **************************************************************** 00003 * Com++ Professional (c) 2009 C++ World 00004 * http://www.cplusplusworld.com/ mailto:compp@cplusplusworld.com 00005 **************************************************************** 00006 **************************************************************** 00007 */ 00008 00009 #ifndef ASRV_H 00010 #define ASRV_H 00011 00012 #include "ComPlusPlus/SocketUdp.h" 00013 #include "ComPlusPlus/Thread.h" 00014 #include "ComPlusPlus/ASrvContext.h" 00015 namespace compp { 00016 class ASrv : public compp::Thread { 00017 00018 public: 00019 ASrv( ); 00020 ASrv( const int port ); 00021 ASrv( const std::string & IPAddr, const int port ); 00022 virtual~ASrv( ); 00023 00024 void Broadcast (const bool BC ) ; 00025 void AddMultiCastGroup (const std::string & IPAddr ) ; 00026 00027 void commenceWork (); 00028 void setPort ( const int p ) { port = p ;} 00029 void setIPAddr ( const std::string & s ) { IPAddr = s ; } 00030 00031 virtual std::string executeTransaction ( const std::string & request, ASrvContext & Context ); 00032 00033 void *Run (void*v); 00034 00035 protected: 00036 00037 std::string IPAddr; 00038 int port; 00039 compp::SocketUdp Server ; 00040 00041 }; 00042 } 00043 00044 #endif
1.6.3