|
| | ServerWrapper (const Config &cfg) |
| | Construct a server from the given configuration.
|
| |
| | ~ServerWrapper () override |
| |
| | ServerWrapper (const ServerWrapper &)=delete |
| |
| ServerWrapper & | operator= (const ServerWrapper &)=delete |
| |
| | ServerWrapper (ServerWrapper &&)=delete |
| |
| ServerWrapper & | operator= (ServerWrapper &&)=delete |
| |
| void | run () override |
| | Run the server (blocks until stop() is called from another thread).
|
| |
| void | stop () override |
| | Stop the server (thread-safe, causes run() to return).
|
| |
| bool | create_group (const std::string &group_id) override |
| | Create a new group at runtime. Returns false if it already exists.
|
| |
| void | delete_group (const std::string &group_id, std::function< void(bool)> callback=nullptr) override |
| | Delete a group (asynchronous). Optional completion callback.
|
| |
| bool | has_group (const std::string &group_id) const override |
| | Check if a group exists.
|
| |
| std::vector< std::string > | group_ids () const override |
| | Get all group IDs as a vector.
|
| |
| std::optional< uint32_t > | rotate_group_key (const std::string &group_id) override |
| | Rotate the encryption key for a group.
|
| |
| void | kick_client (const std::string &client_id, const std::string &reason="") override |
| | Kick a client from the server entirely.
|
| |
| void | kick_client_from_group (const std::string &group_id, const std::string &client_id, const std::string &reason="", std::function< void(bool)> callback=nullptr) override |
| | Kick a client from a specific group (asynchronous). Optional completion callback.
|
| |
| void | send_message_to_client (const std::string &client_id, const std::string &data_type, const uint8_t *data, size_t data_len) override |
| | Send a message from the server to a specific client.
|
| |
| void | send_message_to_group (const std::string &group_id, const std::string &data_type, const uint8_t *data, size_t data_len) override |
| | Send a message from the server to all members of a group.
|
| |
| void | send_message_to_all (const std::string &data_type, const uint8_t *data, size_t data_len) override |
| | Broadcast a message from the server to all connected clients.
|
| |
| void | send_message_to_client (const std::string &client_id, const std::string &data_type, std::span< const uint8_t > data) |
| | Convenience: send to client from a span.
|
| |
| void | send_message_to_group (const std::string &group_id, const std::string &data_type, std::span< const uint8_t > data) |
| | Convenience: send to group from a span.
|
| |
| void | send_message_to_all (const std::string &data_type, std::span< const uint8_t > data) |
| | Convenience: broadcast to all from a span.
|
| |
| void | set_property (const std::string &key, const uint8_t *value, size_t value_len) override |
| | Set a server-level property (pushed to all connected clients).
|
| |
| void | set_group_property (const std::string &group_id, const std::string &key, const uint8_t *value, size_t value_len) override |
| | Set a group-level property (pushed to all group members).
|
| |
| void | on_connection_admission (ConnectionAdmissionCallback cb) override |
| | Gate: accept/reject raw TCP connections by IP and port.
|
| |
| void | on_client_id_check (ClientIdCheckCallback cb) override |
| | Gate: validate a client's self-declared ID.
|
| |
| void | on_password_validate (PasswordValidateCallback cb) override |
| | Gate: custom password validation (replaces built-in == check).
|
| |
| void | on_client_approve (ClientApproveCallback cb) override |
| | Gate: final approval before a client becomes visible to peers.
|
| |
| void | on_client_connected (ClientConnectedCallback cb) override |
| | Event: fired when a client is registered and visible.
|
| |
| void | on_client_disconnected (ClientDisconnectedCallback cb) override |
| | Event: fired when a client is removed from the session.
|
| |
| void | on_group_join_authorize (GroupJoinAuthorizeCallback cb) override |
| | Gate: authorize a group join request.
|
| |
| ivon_server_t | handle () const noexcept |
| |
| virtual | ~IServer ()=default |
| |
|
| using | ConnectionAdmissionCallback = std::function< bool(const std::string &remote_ip, uint16_t remote_port)> |
| | Gate: accept/reject raw TCP connections by IP and port.
|
| |
| using | ClientIdCheckCallback = std::function< bool(const std::string &client_id)> |
| | Gate: validate a client's self-declared ID.
|
| |
| using | PasswordValidateCallback = std::function< bool(const std::string &client_id, const std::string &password)> |
| | Gate: custom password validation (replaces built-in == check).
|
| |
| using | ClientApproveCallback = std::function< bool(const std::string &client_id, const std::string &remote_ip)> |
| | Gate: final approval before a client becomes visible to peers.
|
| |
| using | ClientConnectedCallback = std::function< void(const std::string &client_id, uint64_t session_id)> |
| | Event: fired when a client is registered and visible.
|
| |
| using | ClientDisconnectedCallback = std::function< void(const std::string &client_id, uint64_t session_id, bool graceful)> |
| | Event: fired when a client is removed from the session.
|
| |
| using | GroupJoinAuthorizeCallback = std::function< bool(const std::string &client_id, const std::string &group_id)> |
| | Gate: authorize a group join request.
|
| |
RAII wrapper around the libivon server C ABI.
Non-copyable, non-moveable. Owns an ivon_server_t handle and destroys it on destruction. Use std::unique_ptr for deferred initialization or ownership transfer. All methods delegate to the corresponding ivon_server_* C functions.