www.pudn.com > antispam-addin.rar > conmunicate.hxx
// Conmunicate.h: interface for the Conmunicate class. // ////////////////////////////////////////////////////////////////////// #ifndef CONMUNICATE_H #define CONMUNICATE_H #if defined(WIN32) #define _WINDOWS #endif #if defined(_WINDOWS) || defined(_WIN32) #include#elif defined(unix) #include #include #include #include #include #ifndef SOCKET typedef int SOCKET; #endif #endif //comment by hyr class Conmunicate { public: Conmunicate(); virtual ~Conmunicate(); public: static int StartAccess(int major_version =2, int minor_version =2); bool Create(unsigned int nSocketPort = 0, int nSocketType = SOCK_STREAM, char *szSocketAddress = "" ); virtual bool Connect(char *lpszHostAddress, unsigned int nHostPort); virtual bool Receive( void* lpBuf, int &nBufLen, int nFlags = 0 ); virtual bool Send(const void* lpBuf, int nBufLen, int nFlags = 0 ); virtual bool Close(); protected: private: SOCKET m_hSocket; sockaddr_in m_hSockAddrIn; }; #endif //CONMUNICATE_H