diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2019-09-09 11:59:08 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-09-09 16:24:39 +0000 |
commit | a85e215dd1b027c5ef88621d1b4d5f6e078605da (patch) | |
tree | 2c5b1046788ad231daaecdedad08519ee8ae1a39 /tests/profiling/GatordMockService.hpp | |
parent | 8fccd86b95be418d1b0397bfd5f48a319f210180 (diff) | |
download | armnn-a85e215dd1b027c5ef88621d1b4d5f6e078605da.tar.gz |
IVGCVSW-3720 Start a UDS server that accepts connections.
* Add a CLI paramter to the Gatord mock client to specify a namespace.
* Open a listening socket on that namespace.
* Wait for one connection on the socket.
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: Ic85b4defd5ad2010bb255472c030a91a23cec1d9
Diffstat (limited to 'tests/profiling/GatordMockService.hpp')
-rw-r--r-- | tests/profiling/GatordMockService.hpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/profiling/GatordMockService.hpp b/tests/profiling/GatordMockService.hpp new file mode 100644 index 0000000000..c19e710d69 --- /dev/null +++ b/tests/profiling/GatordMockService.hpp @@ -0,0 +1,50 @@ +// +// Copyright © 2019 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <string> + +namespace armnn +{ + +namespace gatordmock +{ + + +/** + * A class that implements a Mock Gatord server. It will listen on a specified Unix domain socket (UDS) + * namespace for client connections. + */ +class GatordMockService +{ +public: + + /** + * Establish the Unix domain socket and set it to listen for connections. + * + * @param udsNamespace the namespace (socket address) associated with the listener. + * @return true only if the socket has been correctly setup. + */ + bool OpenListeningSocket(std::string udsNamespace); + + /** + * Block waiting to accept one client to connect to the UDS. + * + * @return the file descriptor of the client connection. + */ + int BlockForOneClient(); + +private: + + int m_ListeningSocket; +}; + + +} // namespace gatordmock + +} // namespace armnn + + |