102 IConnection(const IConnection&) = delete;
103 IConnection(IConnection&&) = delete;
104 IConnection& operator=(const IConnection&) = delete;
105 IConnection& operator=(IConnection&&) = delete;
108 virtual ~IConnection() noexcept = default;
112 IConnection() noexcept = default;
Class of serialized message data.
virtual void start(MessageReceivedCallback on_received, MessageSentCallback on_sent, ConnectionClosedCallback on_closed)=0
Start process of this connection.
std::function< void(messages::ParsedMessage)> MessageReceivedCallback
Type of callback functions called when a message is received.
virtual const addresses::IAddress & remote_address() const noexcept=0
Get the address of the remote endpoint.
std::function< void(const Status &)> ConnectionClosedCallback
Type of callback functions called when a connection is closed.
std::function< void()> MessageSentCallback
Type of callback functions called when a message is successfully sent.
virtual void async_close()=0
Asynchronously close this connection.
virtual const addresses::IAddress & local_address() const noexcept=0
Get the address of the local endpoint.
virtual void async_send(const messages::SerializedMessage &message)=0
Asynchronously send a message.
std::variant< ParsedRequest, ParsedResponse, ParsedNotification > ParsedMessage
Type of parsed messages.
Namespace of transport of messages.
Definition of ParsedMessage type.
Definition of SerializedMessage class.
Definition of Status class.