使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
gpg::IMessageListener
这是一个抽象类。
#include <i_message_listener.h>
定义一个接口,用于从远程端点传送消息。
摘要
公共函数
|
OnDisconnected(int64_t client_id, const std::string & remote_endpoint_id)=0
|
virtual void
在远程端点断开连接时调用。
|
OnMessageReceived(int64_t client_id, const std::string & remote_endpoint_id, const std::vector< uint8_t > & payload, bool is_reliable)=0
|
virtual void
在从远程端点收到消息时调用。
|
公共函数
OnDisconnected
virtual void OnDisconnected(
int64_t client_id,
const std::string & remote_endpoint_id
)=0
OnMessageReceived
virtual void OnMessageReceived(
int64_t client_id,
const std::string & remote_endpoint_id,
const std::vector< uint8_t > & payload,
bool is_reliable
)=0
~IMessageListener
virtual ~IMessageListener()
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# gpg::IMessageListener Class Reference\n\ngpg::IMessageListener\n=====================\n\n**This is an abstract class.** \n\n`#include \u003ci_message_listener.h\u003e`\n\nDefines an interface which can be delivered messages from remote endpoints.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~IMessageListener](#classgpg_1_1_i_message_listener_1acc0fdd81937ebdee00a393528260cbdc)`()` ||\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| [OnDisconnected](#classgpg_1_1_i_message_listener_1af7d6fda3f0533b31dd7017289e73cef7)`(int64_t client_id, const std::string & remote_endpoint_id)=0` | `virtual void` Invoked when a remote endpoint is disconnected. |\n| [OnMessageReceived](#classgpg_1_1_i_message_listener_1a7b39ffae7095afc4678825f8f3a319e2)`(int64_t client_id, const std::string & remote_endpoint_id, const std::vector\u003c uint8_t \u003e & payload, bool is_reliable)=0` | `virtual void` Invoked when a message is received from a remote endpoint. |\n\nPublic functions\n----------------\n\n### OnDisconnected\n\n```c++\nvirtual void OnDisconnected(\n int64_t client_id,\n const std::string & remote_endpoint_id\n)=0\n``` \nInvoked when a remote endpoint is disconnected. \n\n### OnMessageReceived\n\n```c++\nvirtual void OnMessageReceived(\n int64_t client_id,\n const std::string & remote_endpoint_id,\n const std::vector\u003c uint8_t \u003e & payload,\n bool is_reliable\n)=0\n``` \nInvoked when a message is received from a remote endpoint. \n\n### \\~IMessageListener\n\n```c++\nvirtual ~IMessageListener()\n```"]]