|
| 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.
|
| |
|
| virtual | ~IServer ()=default |
| |
| virtual void | run ()=0 |
| | Run the server (blocks until stop() is called from another thread).
|
| |
| virtual void | stop ()=0 |
| | Stop the server (thread-safe, causes run() to return).
|
| |
| virtual bool | create_group (const std::string &group_id)=0 |
| | Create a new group at runtime. Returns false if it already exists.
|
| |
| virtual void | delete_group (const std::string &group_id, std::function< void(bool)> callback)=0 |
| | Delete a group (asynchronous). Optional completion callback.
|
| |
| virtual bool | has_group (const std::string &group_id) const =0 |
| | Check if a group exists.
|
| |
| virtual std::vector< std::string > | group_ids () const =0 |
| | Get all group IDs as a vector.
|
| |
| virtual std::optional< uint32_t > | rotate_group_key (const std::string &group_id)=0 |
| | Rotate the encryption key for a group.
|
| |
| virtual void | kick_client (const std::string &client_id, const std::string &reason)=0 |
| | Kick a client from the server entirely.
|
| |
| virtual void | kick_client_from_group (const std::string &group_id, const std::string &client_id, const std::string &reason, std::function< void(bool)> callback)=0 |
| | Kick a client from a specific group (asynchronous). Optional completion callback.
|
| |
| virtual void | send_message_to_client (const std::string &client_id, const std::string &data_type, const uint8_t *data, size_t data_len)=0 |
| | Send a message from the server to a specific client.
|
| |
| virtual void | send_message_to_group (const std::string &group_id, const std::string &data_type, const uint8_t *data, size_t data_len)=0 |
| | Send a message from the server to all members of a group.
|
| |
| virtual void | send_message_to_all (const std::string &data_type, const uint8_t *data, size_t data_len)=0 |
| | Broadcast a message from the server to all connected clients.
|
| |
| virtual void | set_property (const std::string &key, const uint8_t *value, size_t value_len)=0 |
| | Set a server-level property (pushed to all connected clients).
|
| |
| virtual void | set_group_property (const std::string &group_id, const std::string &key, const uint8_t *value, size_t value_len)=0 |
| | Set a group-level property (pushed to all group members).
|
| |
| virtual void | on_connection_admission (ConnectionAdmissionCallback cb)=0 |
| | Set the connection admission gate callback.
|
| |
| virtual void | on_client_id_check (ClientIdCheckCallback cb)=0 |
| | Set the client ID validation callback.
|
| |
| virtual void | on_password_validate (PasswordValidateCallback cb)=0 |
| | Set the password validation callback.
|
| |
| virtual void | on_client_approve (ClientApproveCallback cb)=0 |
| | Set the client approval callback.
|
| |
| virtual void | on_client_connected (ClientConnectedCallback cb)=0 |
| | Set the client connected event callback.
|
| |
| virtual void | on_client_disconnected (ClientDisconnectedCallback cb)=0 |
| | Set the client disconnected event callback.
|
| |
| virtual void | on_group_join_authorize (GroupJoinAuthorizeCallback cb)=0 |
| | Set the group join authorization callback.
|
| |
Pure virtual interface for the libivon server.
Every method here must have a corresponding C ABI function in ivon_server.h and a wrapper in ivon_server_wrapper.hpp. Adding a new pure virtual here will cause a compile error in any class that inherits IServer but hasn't implemented the new method, ensuring the C ABI stays synchronized with the C++ API.