Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
websocket.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
59[[nodiscard]] auto create_connection(std::string_view id = "")
60 -> std::unique_ptr<unified::i_connection>;
61
85[[nodiscard]] auto connect(std::string_view url, std::string_view id = "")
86 -> std::unique_ptr<unified::i_connection>;
87
103[[nodiscard]] auto connect(const unified::endpoint_info& endpoint,
104 std::string_view path = "/",
105 std::string_view id = "")
106 -> std::unique_ptr<unified::i_connection>;
107
138[[nodiscard]] auto create_listener(std::string_view id = "")
139 -> std::unique_ptr<unified::i_listener>;
140
160[[nodiscard]] auto listen(const unified::endpoint_info& bind_address,
161 std::string_view path = "/",
162 std::string_view id = "")
163 -> std::unique_ptr<unified::i_listener>;
164
174[[nodiscard]] auto listen(uint16_t port,
175 std::string_view path = "/",
176 std::string_view id = "")
177 -> std::unique_ptr<unified::i_listener>;
178
179} // namespace kcenon::network::protocol::websocket
Core interface for active network connections.
Core interface for passive network listeners (server-side).
auto create_connection(std::string_view id="") -> std::unique_ptr< unified::i_connection >
Creates a WebSocket connection (not yet started)
Definition websocket.cpp:33
auto listen(const unified::endpoint_info &bind_address, std::string_view path="/", std::string_view id="") -> std::unique_ptr< unified::i_listener >
Creates and starts a WebSocket listener in one call.
Definition websocket.cpp:65
auto create_listener(std::string_view id="") -> std::unique_ptr< unified::i_listener >
Creates a WebSocket listener (not yet listening)
Definition websocket.cpp:59
auto connect(std::string_view url, std::string_view id="") -> std::unique_ptr< unified::i_connection >
Creates and starts a WebSocket connection in one call.
Definition websocket.cpp:39
Network endpoint information (host/port or URL)
Definition types.h:56
Network endpoint types (host/port, URL) and common type aliases.