#include #include #ifdef _WIN32 # include # include #else # include # include #endif #ifndef _SOCKET_CLASS_H #define _SOCKET_CLASS_H public class _Socket { private: static int* m_Socket ; static std::string* m_Error ; static struct sockaddr_in* m_SocketInformation ; public: /* Con- and Destructor */ _Socket(); private: ~_Socket(); public: /* Connect */ bool tryConnect( void ); bool tryConnect( std::string host, const short port ); /* Discnnect */ void tryDisconnect( void ); /* Server information */ void tellHost( std::string host ); void tellHost( const char* host ); void tellPort( const short port ); private: const short getPort( void ) const; const char* getHost( void ) const; const char* getPrevError( void ) const; public: char* tryReceive( void ); char* trySend( void ); bool isAvailable( std::host, const short port ); bool isAvailable( char* host, const short port ); bool isActive( void ); }; #endif