Shared base for Client and Server.
More...
#include <StormByte/network/endpoint.hxx>
|
| std::shared_ptr< Connection::Client > | CreateConnection (std::shared_ptr< Socket::Client > socket) noexcept |
| | Wrap a socket client with input/output pipelines.
|
| |
| virtual Buffer::Pipeline | InputPipeline () const noexcept=0 |
| | Pipeline applied to inbound frame payloads.
|
| |
| virtual Buffer::Pipeline | OutputPipeline () const noexcept=0 |
| | Pipeline applied to outbound frame payloads.
|
| |
| PacketPointer | Send (std::shared_ptr< Connection::Client > client_connection, const Transport::Packet &packet) noexcept |
| | Send packet and wait for a response frame.
|
| |
| bool | Reply (std::shared_ptr< Connection::Client > client_connection, const Transport::Packet &packet) noexcept |
| | Send packet without waiting for a reply.
|
| |
Shared base for Client and Server.
Not instantiated directly. Override InputPipeline() / OutputPipeline(). Use Send() / Reply() for framed request/response.
- Note
- Inheritance-oriented. Derive from Client / Server, not from Endpoint alone.
◆ Endpoint() [1/3]
| StormByte::Network::Endpoint::Endpoint |
( |
const DeserializePacketFunction & |
deserialize_packet_function, |
|
|
std::shared_ptr< Logger::Log > |
logger |
|
) |
| |
|
noexcept |
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).
◆ Endpoint() [3/3]
| StormByte::Network::Endpoint::Endpoint |
( |
Endpoint && |
other | ) |
|
|
defaultnoexcept |
◆ ~Endpoint()
| virtual StormByte::Network::Endpoint::~Endpoint |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ Connect()
| virtual bool StormByte::Network::Endpoint::Connect |
( |
const Connection::Protocol & |
protocol, |
|
|
const std::string & |
address, |
|
|
const unsigned short & |
port |
|
) |
| |
|
pure virtual |
◆ CreateConnection()
| std::shared_ptr< Connection::Client > StormByte::Network::Endpoint::CreateConnection |
( |
std::shared_ptr< Socket::Client > |
socket | ) |
|
|
protectednoexcept |
Wrap a socket client with input/output pipelines.
- Parameters
-
| socket | Underlying socket client. |
- Returns
- Connection::Client.
◆ Disconnect()
| virtual void StormByte::Network::Endpoint::Disconnect |
( |
| ) |
|
|
pure virtualnoexcept |
◆ InputPipeline()
| virtual Buffer::Pipeline StormByte::Network::Endpoint::InputPipeline |
( |
| ) |
const |
|
protectedpure virtualnoexcept |
Pipeline applied to inbound frame payloads.
- Returns
- Pipeline.
◆ operator=() [1/2]
Copy assignment (deleted).
◆ operator=() [2/2]
◆ OutputPipeline()
| virtual Buffer::Pipeline StormByte::Network::Endpoint::OutputPipeline |
( |
| ) |
const |
|
protectedpure virtualnoexcept |
Pipeline applied to outbound frame payloads.
- Returns
- Pipeline.
◆ Reply()
| bool StormByte::Network::Endpoint::Reply |
( |
std::shared_ptr< Connection::Client > |
client_connection, |
|
|
const Transport::Packet & |
packet |
|
) |
| |
|
protectednoexcept |
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
◆ m_logger
| std::shared_ptr<Logger::Log> StormByte::Network::Endpoint::m_logger |
|
protected |
The documentation for this class was generated from the following file: