aboutsummaryrefslogtreecommitdiffstats
path: root/test/RPCSession.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-07 21:34:00 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-09 20:23:34 +0800
commitb508aac64a1c189367a34e79906a7b2553d0ad15 (patch)
tree86648909a0804fc3e5d23a3220db599415dcb554 /test/RPCSession.cpp
parent1b7bb371eec07590177d6af75a90a1e29f3f9d3f (diff)
downloaddexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.tar
dexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.tar.gz
dexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.tar.bz2
dexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.tar.lz
dexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.tar.xz
dexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.tar.zst
dexon-solidity-b508aac64a1c189367a34e79906a7b2553d0ad15.zip
Use only send/recv in IPC
Diffstat (limited to 'test/RPCSession.cpp')
-rw-r--r--test/RPCSession.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp
index 968d77b1..791d2cfe 100644
--- a/test/RPCSession.cpp
+++ b/test/RPCSession.cpp
@@ -73,10 +73,6 @@ IPCSocket::IPCSocket(string const& _path): m_path(_path)
if (connect(m_socket, reinterpret_cast<struct sockaddr const*>(&saun), sizeof(struct sockaddr_un)) < 0)
BOOST_FAIL("Error connecting to IPC socket: " << _path);
-
- m_fp = fdopen(m_socket, "r");
- if (!m_fp)
- BOOST_FAIL("Error opening IPC socket: " << _path);
#endif
}
@@ -113,11 +109,12 @@ string IPCSocket::sendRequest(string const& _req)
return returnStr;
#else
- send(m_socket, _req.c_str(), _req.length(), 0);
+ if (send(m_socket, _req.c_str(), _req.length(), 0) != (ssize_t)_req.length())
+ BOOST_FAIL("Writing on IPC failed");
char c;
string response;
- while ((c = fgetc(m_fp)) != EOF)
+ while (recv(m_socket, &c, 1, 0) == 1)
{
if (c != '\n')
response += c;