Is it possible for android devices to exchange messages over an access point and request a list of connected devices to this AP?

ε祈祈猫儿з 提交于 2019-12-06 10:04:29

If you have your application running on all clients your interested in you could try to using a simple UDP broadcast. In every application on each client you'd just listen for a certian UDP packet on a specific port and once you receive it respond to the sender so that it will know that there's an app listening there. After that it should be easy to establish regular TCP connection. This method works only for LANs since UDP broadcasts are usually not routed. It is commonly used by games to search for active servers in local area networks.

There is no defined protocol for querying an AP for devices; you might want to go through one of the well-known discovery mechanisms (ZeroConf/Bonjour/Avahi, UPnP, DPWS, ...).

Here's an example in java of enumerating all the ip addresses on a lan and then testing which ones are active.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!