Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
tcp_connection.hpp File Reference

TCP connections exchanging length-prefixed messages, and the listener accepting them. More...

#include <aegis2d/net/context.hpp>
#include <aegis2d/net/endpoint.hpp>
#include <aegis2d/net/export.hpp>
#include <aegis2d/net/socket_error.hpp>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <span>
#include <system_error>

Go to the source code of this file.

Classes

class  aegis2d::net::TcpConnection
 TCP connection exchanging whole messages over the byte stream. More...
 
struct  aegis2d::net::TcpConnection::Stats
 Counters since the connection was opened. More...
 
class  aegis2d::net::TcpListener
 Listening TCP socket handing every accepted peer over as a TcpConnection. More...
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::net
 Binary serialization, UDP/TCP sockets and the network thread.
 

Enumerations

enum class  aegis2d::net::TcpCloseReason : std::uint8_t { aegis2d::net::PeerClosed , aegis2d::net::Error , aegis2d::net::MessageTooLarge }
 Why a TcpConnection closed by itself. More...
 

Variables

constexpr std::size_t aegis2d::net::max_message_size = 4096
 Largest message a TcpConnection sends or accepts, in bytes, prefix excluded.
 
constexpr std::size_t aegis2d::net::message_prefix_size = 2
 Size of the length prefix in front of each message: a little-endian u16.
 

Detailed Description

TCP connections exchanging length-prefixed messages, and the listener accepting them.