aboutsummaryrefslogtreecommitdiffstats
path: root/test/RPCSession.h
diff options
context:
space:
mode:
authorDmitry K <winsvega@mail.ru>2016-08-03 00:32:03 +0800
committerDmitry K <winsvega@mail.ru>2016-08-03 00:32:03 +0800
commit5925ae0c6a32517f3b19b095e3ed8518d021f2e7 (patch)
tree117140938964c4b555856ae340d907e917e4efbb /test/RPCSession.h
parenta10b6f92f97bf2eacc80534f6640e08f0b26e95d (diff)
downloaddexon-solidity-5925ae0c6a32517f3b19b095e3ed8518d021f2e7.tar.gz
dexon-solidity-5925ae0c6a32517f3b19b095e3ed8518d021f2e7.tar.zst
dexon-solidity-5925ae0c6a32517f3b19b095e3ed8518d021f2e7.zip
Windows pipe for soltest
Diffstat (limited to 'test/RPCSession.h')
-rw-r--r--test/RPCSession.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/RPCSession.h b/test/RPCSession.h
index fd77ceca..9b7009bf 100644
--- a/test/RPCSession.h
+++ b/test/RPCSession.h
@@ -19,33 +19,35 @@
* @date 2016
*/
-#include <string>
-#include <stdio.h>
-#include <map>
#if defined(_WIN32)
+#include <windows.h>
+#include "libdevcore/UndefMacros.h"
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#endif
+
+#include <string>
+#include <stdio.h>
+#include <map>
#include <json/value.h>
#include <boost/test/unit_test.hpp>
#if defined(_WIN32)
+const int c_buffsize = 5120000; //because windows pipe is broken and wont work as in examples. use larger buffer limit to receive whole package in one call
class IPCSocket : public boost::noncopyable
{
public:
IPCSocket(std::string const& _path);
std::string sendRequest(std::string const& _req);
- ~IPCSocket() { fclose(m_fp); }
+ ~IPCSocket() { CloseHandle(m_socket); }
std::string const& path() const { return m_path; }
private:
- FILE *m_fp;
std::string m_path;
- int m_socket;
-
+ HANDLE m_socket;
};
#else
class IPCSocket: public boost::noncopyable
@@ -61,7 +63,6 @@ private:
FILE *m_fp;
std::string m_path;
int m_socket;
-
};
#endif