aboutsummaryrefslogtreecommitdiff
path: root/tests/profiling/gatordmock/GatordMockService.hpp
diff options
context:
space:
mode:
authorRob Hughes <robert.hughes@arm.com>2020-01-13 11:14:59 +0000
committerRob Hughes <robert.hughes@arm.com>2020-01-21 16:01:58 +0000
commit25b7436b02514145a0289daff78f5b9f64cdd0db (patch)
treeef574302d4dda7e67e5c05b999bcd5b09d3c9190 /tests/profiling/gatordmock/GatordMockService.hpp
parent41e92b085aa543cba57610135168185632ed0799 (diff)
downloadarmnn-25b7436b02514145a0289daff78f5b9f64cdd0db.tar.gz
Add thin abstraction layer for network sockets
This makes SocketProfilingConnection and GatordMock work on Windows as well as Linux Change-Id: I4b10c079b653a1c3f61eb20694e5b5f8a6f5fdfb Signed-off-by: Robert Hughes <robert.hughes@arm.com>
Diffstat (limited to 'tests/profiling/gatordmock/GatordMockService.hpp')
-rw-r--r--tests/profiling/gatordmock/GatordMockService.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/profiling/gatordmock/GatordMockService.hpp b/tests/profiling/gatordmock/GatordMockService.hpp
index c3afc333ca..f91e902db8 100644
--- a/tests/profiling/gatordmock/GatordMockService.hpp
+++ b/tests/profiling/gatordmock/GatordMockService.hpp
@@ -7,6 +7,7 @@
#include <CommandHandlerRegistry.hpp>
#include <Packet.hpp>
+#include <NetworkSockets.hpp>
#include <atomic>
#include <string>
@@ -49,8 +50,8 @@ public:
~GatordMockService()
{
// We have set SOCK_CLOEXEC on these sockets but we'll close them to be good citizens.
- close(m_ClientConnection);
- close(m_ListeningSocket);
+ armnnUtils::Sockets::Close(m_ClientConnection);
+ armnnUtils::Sockets::Close(m_ListeningSocket);
}
/// Establish the Unix domain socket and set it to listen for connections.
@@ -60,7 +61,7 @@ public:
/// Block waiting to accept one client to connect to the UDS.
/// @return the file descriptor of the client connection.
- int BlockForOneClient();
+ armnnUtils::Sockets::Socket BlockForOneClient();
/// Once the connection is open wait to receive the stream meta data packet from the client. Reading this
/// packet differs from others as we need to determine endianness.
@@ -147,8 +148,8 @@ private:
armnn::profiling::CommandHandlerRegistry& m_HandlerRegistry;
bool m_EchoPackets;
- int m_ListeningSocket;
- int m_ClientConnection;
+ armnnUtils::Sockets::Socket m_ListeningSocket;
+ armnnUtils::Sockets::Socket m_ClientConnection;
std::thread m_ListeningThread;
std::atomic<bool> m_CloseReceivingThread;
};