#if !defined(WASOCKETCONNECTION_H) #define WASOCKETCONNECTION_H #include "common.h" #include "WhatsAPI++/ISocketConnection.h" #include #include "WhatsAPI++/WAException.h" #include "WhatsAPI++/WALogin.h" #include "WhatsAPI++/base64.h" #include class WASocketConnection : public ISocketConnection { public: static HANDLE hNetlibUser; private: int readSize; int maxBufRead; bool connected; HANDLE hConn; public: WASocketConnection(const std::string& dir, int port) throw (WAException); void write(int i); unsigned char read(); void flush(); void write(const std::vector& b, int length); void write(const std::vector& bytes, int offset, int length); int read(std::vector& b, int off, int length); void makeNonBlock(); int waitForRead(); void forceShutdown(); virtual ~WASocketConnection(); static void initNetwork(HANDLE hNetlibUser) throw (WAException); static void quitNetwork(); }; #endif // WASOCKETCONNECTION_H