Shared base for Client and Server.
More...
#include <StormByte/network/endpoint.hxx>
Shared base for Client and Server.
Not instantiated directly. Connections start with no-op pipelines. Derived Client and Server types configure individual connections explicitly. Use Send() / Reply() for framed request/response.
- Note
- Inheritance-oriented. Derive from Client / Server, not from Endpoint alone.
◆ Endpoint() [1/3]
Construct with a packet factory and a logger.
- Parameters
-
| deserialize_packet_function | Builds domain packets from wire data. |
| logger | Diagnostic logger. |
◆ Endpoint() [2/3]
| StormByte::Network::Endpoint::Endpoint |
( |
const Endpoint & | other | ) |
|
|
delete |
Copy constructor (deleted).
- Parameters
-
◆ Endpoint() [3/3]
| StormByte::Network::Endpoint::Endpoint |
( |
Endpoint && | other | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
| other | Endpoint whose state is transferred. |
◆ ~Endpoint()
| virtual StormByte::Network::Endpoint::~Endpoint |
( |
| ) |
|
|
virtualnoexcept |
◆ Connect()
| virtual bool StormByte::Network::Endpoint::Connect |
( |
const Connection::Protocol & | protocol, |
|
|
std::string_view | address, |
|
|
const unsigned short & | port ) |
|
pure virtual |
◆ CreateConnection()
Wrap a socket client with initially empty input/output pipelines.
- Parameters
-
| socket | Underlying socket client. |
- Returns
- Connection::Client.
◆ Disconnect()
| virtual void StormByte::Network::Endpoint::Disconnect |
( |
| ) |
|
|
pure virtualnoexcept |
◆ operator=() [1/2]
Copy assignment (deleted).
- Parameters
-
- Returns
- Reference to this endpoint (operation is deleted).
◆ operator=() [2/2]
Move assignment.
- Parameters
-
| other | Endpoint whose state is transferred. |
- Returns
- Reference to this endpoint.
◆ Reply()
Send packet without waiting for a reply.
- Parameters
-
| client_connection | Active connection. |
| packet | Packet to send. |
- Returns
- true on success.
◆ Send()
Send packet and wait for a response frame.
- Parameters
-
| client_connection | Active connection. |
| packet | Packet to send. |
- Returns
- Response packet, or nullptr on failure.
◆ Status()
◆ m_deserialize_packet_function
Packet factory used to deserialize received wire data.
◆ m_logger
Shared diagnostic logger for this endpoint.
The documentation for this class was generated from the following file: