使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
gpg::IEndpointDiscoveryListener
这是一个抽象类。
#include <i_endpoint_discovery_listener.h>
定义一个接口,用于传送与远程端点发现相关的事件。
摘要
公共函数
|
OnEndpointFound(int64_t client_id, const EndpointDetails & endpoint_details)=0
|
virtual void
在找到远程端点时调用;对于每个发现的端点,都会调用一次。
|
OnEndpointLost(int64_t client_id, const std::string & remote_endpoint_id)=0
|
virtual void
在远程端点无法再被发现时调用;仅使用之前传递给 OnEndpointFound 的 ID 调用。
|
公共函数
OnEndpointFound
virtual void OnEndpointFound(
int64_t client_id,
const EndpointDetails & endpoint_details
)=0
在找到远程端点时调用;对于每个发现的端点,都会调用一次。
请注意,此方法可能会在短时间内反复调用;您可能需要延迟对界面的更新,以便在调用此方法后的一小段时间内反映新端点。
OnEndpointLost
virtual void OnEndpointLost(
int64_t client_id,
const std::string & remote_endpoint_id
)=0
在远程端点无法再被发现时调用;仅使用之前传递给 OnEndpointFound
的 ID 调用。
请注意,此方法可能会在短时间内反复调用;您可能需要延迟对界面的更新,以反映在调用此方法后端点消失了一小段时间。
~IEndpointDiscoveryListener
virtual ~IEndpointDiscoveryListener()
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# gpg::IEndpointDiscoveryListener Class Reference\n\ngpg::IEndpointDiscoveryListener\n===============================\n\n**This is an abstract class.** \n\n`#include \u003ci_endpoint_discovery_listener.h\u003e`\n\nDefines an interface which can be delivered events relating to remote endpoint discovery.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~IEndpointDiscoveryListener](#classgpg_1_1_i_endpoint_discovery_listener_1af718bcd26588adb81940859a661c259e)`()` ||\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [OnEndpointFound](#classgpg_1_1_i_endpoint_discovery_listener_1a63a9026d38cd0f4cd243c0b78de3e912)`(int64_t client_id, const `[EndpointDetails](/games/services/cpp/api/struct/gpg/endpoint-details#structgpg_1_1_endpoint_details)` & endpoint_details)=0` | `virtual void` Invoked when a remote endpoint is found; will be invoked once for each endpoint discovered. |\n| [OnEndpointLost](#classgpg_1_1_i_endpoint_discovery_listener_1a51c0db65f67b47f105cd44b89ced342a)`(int64_t client_id, const std::string & remote_endpoint_id)=0` | `virtual void` Invoked when a remote endpoint is no longer discoverable; will only be called with IDs that previously were passed to `OnEndpointFound`. |\n\nPublic functions\n----------------\n\n### OnEndpointFound\n\n```c++\nvirtual void OnEndpointFound(\n int64_t client_id,\n const EndpointDetails & endpoint_details\n)=0\n``` \nInvoked when a remote endpoint is found; will be invoked once for each endpoint discovered.\n\nNote that this method may be invoked repeatedly in short succession; you may wish to delay the update to the UI to reflect the new endpoint for some short time period after the method is invoked. \n\n### OnEndpointLost\n\n```c++\nvirtual void OnEndpointLost(\n int64_t client_id,\n const std::string & remote_endpoint_id\n)=0\n``` \nInvoked when a remote endpoint is no longer discoverable; will only be called with IDs that previously were passed to `OnEndpointFound`.\n\nNote that this method may be invoked repeatedly in short succession; you may with to delay the update to the UI to reflect the endpoint being gone for some short time period after the method is invoked. \n\n### \\~IEndpointDiscoveryListener\n\n```c++\nvirtual ~IEndpointDiscoveryListener()\n```"]]