Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
tcp.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
12#pragma once
13
25
26#include <memory>
27#include <string>
28#include <string_view>
29
31
50[[nodiscard]] auto create_connection(std::string_view id = "")
51 -> std::unique_ptr<unified::i_connection>;
52
71[[nodiscard]] auto connect(const unified::endpoint_info& endpoint,
72 std::string_view id = "")
73 -> std::unique_ptr<unified::i_connection>;
74
81[[nodiscard]] auto connect(std::string_view url, std::string_view id = "")
82 -> std::unique_ptr<unified::i_connection>;
83
103[[nodiscard]] auto create_listener(std::string_view id = "")
104 -> std::unique_ptr<unified::i_listener>;
105
124[[nodiscard]] auto listen(const unified::endpoint_info& bind_address,
125 std::string_view id = "")
126 -> std::unique_ptr<unified::i_listener>;
127
136[[nodiscard]] auto listen(uint16_t port, std::string_view id = "")
137 -> std::unique_ptr<unified::i_listener>;
138
139} // namespace kcenon::network::protocol::tcp
Core interface for active network connections.
Core interface for passive network listeners (server-side).
auto listen(const unified::endpoint_info &bind_address, std::string_view id="") -> std::unique_ptr< unified::i_listener >
Creates and starts a TCP listener in one call.
Definition tcp.cpp:62
auto create_listener(std::string_view id="") -> std::unique_ptr< unified::i_listener >
Creates a TCP listener (not yet listening)
Definition tcp.cpp:56
auto connect(const unified::endpoint_info &endpoint, std::string_view id="") -> std::unique_ptr< unified::i_connection >
Creates and connects a TCP connection in one call.
Definition tcp.cpp:39
auto create_connection(std::string_view id="") -> std::unique_ptr< unified::i_connection >
Creates a TCP connection (not yet connected)
Definition tcp.cpp:33
Network endpoint information (host/port or URL)
Definition types.h:56
Network endpoint types (host/port, URL) and common type aliases.