#ifndef _CAPSERVER_GENERICSERVER_HPP_ #define _CAPSERVER_GENERICSERVER_HPP_ #ifndef _COMMON_STRING_HPP_ #include #endif #ifndef _COMMON_SMARTPOINTER_HPP_ #include #endif #ifndef _SOCKET_HOSTENT_HPP_ #include #endif #ifndef _SOCKET_SERVENT_HPP_ #include #endif #ifndef _SOCKET_INETSOCKETADDRESS_HPP_ #include #endif #ifndef _SOCKET_SOCKET_HPP_ #include #endif class GenericServer { public: GenericServer(void); virtual ~GenericServer(); WORD listen(const String &hostName,short portNum); WORD receive(char &charData,BOOL waitForData=TRUE); void close(void); protected: virtual void acceptHandler(SmartPointer &socketControl); virtual void message(const String &message); virtual void message(Block &msgData); private: enum{TimeOut=1000}; INETSocketAddress mInternetSocketAddress; Socket mGenericControl; WSASystem mWSASystem; BOOL mIsRunning; }; #endif