Android IP address with java

后端 未结 3 2035
春和景丽
春和景丽 2021-01-07 05:38

I\'m writing an Android video game that supports multiplayer. There is a dedicated server running which the androids connect to when the multiplayer button is clicked by ope

3条回答
  •  -上瘾入骨i
    2021-01-07 06:15

    Do you have to rely on the host to figure out its own IP address and provide this to the server? If the host opens a connection and sends a message to the server announcing that it is hosting a game, then could the server use the IP address that the connection and message came from? This would avoid the problem altogether.

提交回复
热议问题