diff options
author | Fishbone <fishbone@miranda-ng.org> | 2013-06-02 16:19:21 +0000 |
---|---|---|
committer | Fishbone <fishbone@miranda-ng.org> | 2013-06-02 16:19:21 +0000 |
commit | ab7e0b08fa8c31cf1d468ab4b3c660e2b1836811 (patch) | |
tree | 52977603ea0f431adff16573d3d5b46a95843c7f /protocols/WhatsApp/src/WASocketConnection.h | |
parent | 8320783f99419db1e40346fdb292c19ee008948b (diff) |
Added WhatsApp-protocol
git-svn-id: http://svn.miranda-ng.org/main/trunk@4861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WASocketConnection.h')
-rw-r--r-- | protocols/WhatsApp/src/WASocketConnection.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/WASocketConnection.h b/protocols/WhatsApp/src/WASocketConnection.h new file mode 100644 index 0000000000..f2d46415bc --- /dev/null +++ b/protocols/WhatsApp/src/WASocketConnection.h @@ -0,0 +1,41 @@ +#if !defined(WASOCKETCONNECTION_H)
+#define WASOCKETCONNECTION_H
+
+#include "common.h"
+#include "WhatsAPI++/ISocketConnection.h"
+#include <iostream>
+#include "WhatsAPI++/WAException.h"
+#include "WhatsAPI++/WALogin.h"
+#include "WhatsAPI++/base64.h"
+#include <windows.h>
+
+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<unsigned char>& b, int length);
+ void write(const std::vector<unsigned char>& bytes, int offset, int length);
+ int read(std::vector<unsigned char>& 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
\ No newline at end of file |