From bbfe603e5ae42317a2b67d713d00882bea341c88 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Mon, 20 Jul 2020 16:57:44 +0100 Subject: IVGCVSW-5166 Pull out the common and server side code into standalone libraries Change-Id: I180f84c493a9b2be4b93b25d312ebdd9e71b1735 Signed-off-by: Jim Flynn --- .../src/basePipeServer/ConnectionHandler.cpp | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'profiling/server/src/basePipeServer/ConnectionHandler.cpp') diff --git a/profiling/server/src/basePipeServer/ConnectionHandler.cpp b/profiling/server/src/basePipeServer/ConnectionHandler.cpp index 1485ab8620..1c9ffa95c2 100644 --- a/profiling/server/src/basePipeServer/ConnectionHandler.cpp +++ b/profiling/server/src/basePipeServer/ConnectionHandler.cpp @@ -1,18 +1,21 @@ // -// Copyright © 2020 Arm Ltd. All rights reserved. +// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // -#include "ConnectionHandler.hpp" -#include +#include -using namespace armnnUtils; +#include -namespace armnnProfiling +namespace arm { + +namespace pipe +{ + ConnectionHandler::ConnectionHandler(const std::string& udsNamespace, const bool setNonBlocking) { - Sockets::Initialize(); + arm::pipe::Initialize(); m_ListeningSocket = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); if (-1 == m_ListeningSocket) @@ -39,14 +42,13 @@ ConnectionHandler::ConnectionHandler(const std::string& udsNamespace, const bool if (setNonBlocking) { - Sockets::SetNonBlocking(m_ListeningSocket); + arm::pipe::SetNonBlocking(m_ListeningSocket); } } std::unique_ptr ConnectionHandler::GetNewBasePipeServer(const bool echoPackets) { - armnnUtils::Sockets::Socket clientConnection = armnnUtils::Sockets::Accept(m_ListeningSocket, nullptr, nullptr, - SOCK_CLOEXEC); + arm::pipe::Socket clientConnection = arm::pipe::Accept(m_ListeningSocket, nullptr, nullptr, SOCK_CLOEXEC); if (clientConnection < 1) { return nullptr; @@ -54,4 +56,5 @@ std::unique_ptr ConnectionHandler::GetNewBasePipeServer(const bo return std::make_unique(clientConnection, echoPackets); } -} // namespace armnnProfiling \ No newline at end of file +} // namespace pipe +} // namespace arm -- cgit v1.2.1