SNode.C
Loading...
Searching...
No Matches
SocketConnection.hpp
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "core/socket/stream/SocketConnection.hpp"
21#include "core/socket/stream/legacy/SocketConnection.h"
22
23#ifndef DOXYGEN_SHOULD_SKIP_THIS
24
25#include <utility>
26
27#endif // DOXYGEN_SHOULD_SKIP_THIS
28
29namespace core::socket::stream::legacy {
30
31 template <typename PhysicalSocket>
32 SocketConnection<PhysicalSocket>::SocketConnection(const std::string& instanceName,
33 PhysicalSocket&& physicalSocket,
34 const std::function<void(SocketConnection*)>& onDisconnect,
35 const std::string& configuredServer,
36 const SocketAddress& localAddress,
37 const SocketAddress& remoteAddress,
38 const utils::Timeval& readTimeout,
39 const utils::Timeval& writeTimeout,
40 std::size_t readBlockSize,
41 std::size_t writeBlockSize,
42 const utils::Timeval& terminateTimeout)
43 : Super(
46 [onDisconnect, this]() {
47 onDisconnect(this);
48 },
57 }
58
59} // namespace core::socket::stream::legacy
virtual ~Socket()
Definition Socket.hpp:34
Config & getConfig() const
Definition Socket.hpp:38
std::shared_ptr< Config > config
Definition Socket.h:50
Socket(const std::string &name)
Definition Socket.hpp:29
SocketConnection(const std::string &instanceName, PhysicalSocket &&physicalSocket, const std::function< void(SocketConnection *)> &onDisconnect, const std::string &configuredServer, const SocketAddress &localAddress, const SocketAddress &remoteAddress, const utils::Timeval &readTimeout, const utils::Timeval &writeTimeout, std::size_t readBlockSize, std::size_t writeBlockSize, const utils::Timeval &terminateTimeout)
Definition Config.h:37