// Version 0.2 // 15 December 2006 // Definition of the Socket class #ifndef Socket_class #define Socket_class #include #include #include #include #include #include #include #include const int MAXHOSTNAME = 200; const int MAXCONNECTIONS = 5; const int MAXRECV = 500; class Socket { private: int m_sock; sockaddr_in m_addr; struct hostent *he; public: Socket(); virtual ~Socket(); //etc bool is_valid() const { return m_sock != -1; } //server initializtion for udp bool createWithUDP(); bool bind ( const int port ); //Data Transmission for udp bool sendto ( const std::string s ) const; int recvfrom( std::string & ) const; bool setHost( const std::string hostName, const int port); int checkBuffer(); }; #endif