|
unilink
0.4.3
A simple C++ library for unified async communication
|
Interface for 1:N server communication (e.g., TcpServer) More...
#include <iserver.hpp>
Public Types | |
| using | MessageHandler = std::function< void(const MessageContext &)> |
| using | ConnectionHandler = std::function< void(const ConnectionContext &)> |
| using | ErrorHandler = std::function< void(const ErrorContext &)> |
Public Member Functions | |
| virtual | ~ServerInterface ()=default |
| virtual std::future< bool > | start ()=0 |
| virtual void | stop ()=0 |
| virtual bool | is_listening () const =0 |
| virtual bool | broadcast (std::string_view data)=0 |
| virtual bool | send_to (size_t client_id, std::string_view data)=0 |
| virtual ServerInterface & | on_client_connect (ConnectionHandler handler)=0 |
| virtual ServerInterface & | on_client_disconnect (ConnectionHandler handler)=0 |
| virtual ServerInterface & | on_data (MessageHandler handler)=0 |
| virtual ServerInterface & | on_error (ErrorHandler handler)=0 |
| virtual size_t | get_client_count () const =0 |
| virtual std::vector< size_t > | get_connected_clients () const =0 |
Interface for 1:N server communication (e.g., TcpServer)
Definition at line 34 of file iserver.hpp.
| using unilink::wrapper::ServerInterface::ConnectionHandler = std::function<void(const ConnectionContext&)> |
Definition at line 37 of file iserver.hpp.
| using unilink::wrapper::ServerInterface::ErrorHandler = std::function<void(const ErrorContext&)> |
Definition at line 38 of file iserver.hpp.
| using unilink::wrapper::ServerInterface::MessageHandler = std::function<void(const MessageContext&)> |
Definition at line 36 of file iserver.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.
|
pure virtual |
Implemented in unilink::wrapper::TcpServer.