Jump to content
  • Advertisement
Sign in to follow this  
Naash

Android WiFi Direct issues

This topic is 495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi

    I am working on a multiplayer game which involves connectivity using WiFi Direct. So I have come across an issue.

From my game if device 'A' sends request to device 'B' and device 'B' declines it, then device 'A' cannot send another request to device 'B' . Why is this happening and what all should I keep in mind to prevent this ?

Thanks in advance :)

Share this post


Link to post
Share on other sites
Advertisement
Presumably the other end already caches the fact that the request was declined, to avoid having to decline a flood of persistent requests.
I think the only thing you can do is not decline the request, or wait until some kind of time-out.
You should make sure to cancel/destroy any previous invitations.
Perhaps turn WiFi off and on again on both devices might reset the decline-cache?

Note that the core WiFi code doesn't know what to do when the invitation is declined; check out the comment on line 1707:
https://android.googlesource.com/platform/frameworks/base/+/b267554/wifi/java/android/net/wifi/p2p/WifiP2pService.java

Overall, I think WiFi Direct is not a great technology. It might help with connectivity when two people want to share pictures and are in the middle of the jungle with no access point or cell phone tower nearby, but otherwise, using regular IP networking over regular WiFi is much better.

Share this post


Link to post
Share on other sites

Overall, I think WiFi Direct is not a great technology. It might help with connectivity when two people want to share pictures and are in the middle of the jungle with no access point or cell phone tower nearby, but otherwise, using regular IP networking over regular WiFi is much better.

I wish Android would do some equivalent of iOS's multipeer and bundle all their direct device-to-device technologies under one comms layer agnostic API. I don't really want to have to write code to support bluetooth, WiFi Direct and WiFi Aware (new for Android O - https://developer.android.com/preview/features/wifi-aware.html) just for some 1 vs 1 multiplayer to accomodate a minority of users who want to play when there's no router around.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!