Sending data in Android WiFi Direct service discovery instead of connecting

点点圈 提交于 2019-12-01 08:45:27
  • The key/value pairs you pass into WifiP2pDnsSdServiceInfo object are going to be encapsulated into DNS multicast messages, as specified in DNS-Based Service Discovery.

  • Multicast traffic on WiFi is especially expensive, so it is not recommended to use this for messaging. Only for critical things like service discovery.

  • Depending on implementation (android), the under framework may pool all service discovery records/responses, before it calls your callbacks. This can add significant (even unpredictable) delay for your simple P2P messaging.

  • This is basically a DNS messaging, so your "messages" may be cached locally. DNS queries could also try mid-level optimizations like pooling, retries, query filtering, prioritization etc.

  • There is no reliability guarantee so your messages may be lost.

  • Multicast traffic, which is used here, can result in significant battery drain on android, see here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!