I've been working with the Android WifiP2pManager to discover specific services on other devices. I'm wondering if there is a known timeout period for the function
public void discoverServices (WifiP2pManager.Channel c, WifiP2pManager.ActionListener listener)
As far as I know the clearServiceRequests() should work fine for cancelling service discovery.
In general I have also not found any docs for timeout, thus I have been using 1 minute timeout timer to fix the issue.
Notice though that you should cancel the timeout timer once you have gotten the callback called once, after that you should just wait for new services being discovered.
I have also not seen any docs for how long the service discovery timeout should be between different services, but with some testing I have determined that it should be at least 5 seconds, in order to get services available discovered nicely.