adroitandroid / Near

A P2P library for Android for discovery on local networks using UDP and transfer in general using TCP sockets
https://goo.gl/kioAiQ
MIT License
349 stars 92 forks source link

>2 devices and host/peer setup #7

Closed layton322 closed 6 years ago

layton322 commented 6 years ago

Hi there,

Firstly, thank you for the fantastic job you've done with this API! It's made P2P vastly simpler and cleaner for me. I would like to make use of the API for a project I am working on - notably, a game involving up to 5 devices, with one 'host' device and four peer users. The peer users will need to send data to the host, and the host will have to send data out to all peer users.

I have seen the API used effectively in your sample app for two-way communication - for more users, is it as simple as opening up the discovery process again on a designated 'host' device? I.e. can one device maintain active connections with multiple devices and be able to send out messages that are picked up by them all?

Thanks!

adroitandroid commented 6 years ago

Hi, glad you found this useful. You can make multiple devices discoverable that can all be discovered by any host that starts discovering. An active connection is created only while transferring from one device to another and you can transfer to multiple devices

adroitandroid commented 6 years ago

Hi, glad you found this useful. You can make multiple devices discoverable that can all be discovered by any host that starts discovering. An active connection is created only while transferring from one device to another and you can transfer to multiple devices