2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief SocketHandle inline non-template implementation
18 #include "SocketHandle.ih"
21 #include "SocketProtocol.hh"
23 #define prefix_ inline
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 prefix_ senf::SocketBody::SocketBody(bool isServer)
30 prefix_ senf::SocketBody::SocketBody(bool isServer, int fd)
31 : FileBody(fd), isServer_(isServer)
34 prefix_ senf::SocketProtocol & senf::SocketBody::protocol()
37 return const_cast<SocketProtocol &>(v_protocol());
40 prefix_ bool senf::SocketBody::isServer()
45 prefix_ std::unique_ptr<senf::SocketBody> senf::SocketBody::clone(bool isServer)
48 return protocol().clone(isServer);
51 prefix_ std::unique_ptr<senf::SocketBody> senf::SocketBody::clone(int fd, bool isServer)
54 return protocol().clone(fd, isServer);
57 //-/////////////////////////////////////////////////////////////////////////////////////////////////
58 // senf::detail::StreamableString
60 prefix_ senf::detail::StreamableString & senf::detail::StreamableString::operator<<(bool v)
62 return (*this) << std::string(v ? "true" : "false");
65 //-/////////////////////////////////////////////////////////////////////////////////////////////////
72 // c-file-style: "senf"
73 // indent-tabs-mode: nil
74 // ispell-local-dictionary: "american"
75 // compile-command: "scons -u test"