How can I connect two Android device by socket without server

后端 未结 4 998
半阙折子戏
半阙折子戏 2021-02-08 12:14

I am trying to develop an android application that can exchange data on peer to peer connection with other devices without server. So please suggest how can I do this. Thank you

4条回答
  •  轮回少年
    2021-02-08 13:03

    Your design has a big problem : ...

    If there is no central server some android devices should act as client and others as server but this will not work in some situations:

    • When the mobile telephony provider assigns private and non-public IP

    • When the device is connected to a Wi-Fi network but no NAT rule is defined on the router.

    In both cases the problem is that the listening port of the device that must act as server is unreachable.

提交回复
热议问题