android - NsdManager 从未在 Google Pixel 3 (Pie) 上发现任何服务
问题描述
相同的代码适用于三星 S8 和索尼 XZ,但不适用于 Google Pixel 3。
我从 NsdManager 开始发现:
nsdManager.discoverServices("_test_service._tcp.", NsdManager.PROTOCOL_DNS_SD, discoveryListener)
discoveryListener 提供与指定的相同 serviceType 的 onDiscoveryStarted 回调。我和我的服务坐在同一个 wifi 上,我等着等,但没有 onServiceFound 回调来。在三星 S8 和索尼 XZ 上开始发现后,onServiceFound 回调会出现毫秒。
Google Pixel 3 的 NsdManager 是否存在任何已知问题?
解决方案
推荐阅读
- typescript - TypeScript - 参数属性的类型保护
- python - 通过值的旋转变换矩阵
- node.js - 为什么当 headless 设置为 false 时 puppeteer 不允许 pdf 下载?
- java - 为什么动画从下到上移动对象而不是从上到下?
- c# - 有没有办法从托管在 Web 服务器中的 Web 应用程序访问客户端(用户)特殊文件夹
- android - 我们可以在没有特定平台的情况下集成 Firebase 并响应本机应用程序吗?
- c - 将指针传递给函数中的重新分配指针
- .net-core - .NET Core 3.0 中的 Outlook 互操作?
- c# - 如何检查角色列表中的角色?
- javascript - 检查 getAttribute 是否未定义