Why does Android Wi-Fi Direct only return one service at a time with DiscoverServices?

When you call discoverPeers in Wi-Fi Direct, it returns a list of peers to the onPeersAvailable method in PeerListListener (after calling requestPeers ). However, when you call discoverServices , you only get one service at a time in the onDnsSdServiceAvailable method in the DnsSdServiceResponseListener . Does anyone know if there is a way to change this and get all the services at a particular point in time? Or, if there is a specific reason why it can only return one at a time?

+5
source share
1 answer

As far as I know, there is no way to change this. They are given only one by one, and the timing has not been established either.

Everyone and everyone, the proposed way to handle them all is to implement a timer that reset every time you receive a discovery, and it fires before it is discovered, you must determine that all peer services have been discovered. Sucks, but the way it works.

+1
source

Source: https://habr.com/ru/post/1247780/


All Articles