Code Monkey home page Code Monkey logo

Comments (1)

reznor avatar reznor commented on August 22, 2024

P2P_STAR is meant for 1:N connection topologies, so it's going to be difficult (not impossible, but complicated, because you essentially need master-election) for you to build a self-assembling network using that -- that's because once an Advertiser establishes the first incoming connection, it cannot then make any outgoing connections (because it is now the "1" in the 1:N topology).

A better way to model this might be to have every Advertiser a random number as a part of its endpointName, with the rule that everyone will only connect to the Advertiser with the highest number it sees; that achieves a rudimentary master-election without a prior shared control plane, but you'll need some tweaks like letting all Discoverers discover for some fixed time (like 20 seconds) before ranking all the Advertisers it sees (to decide who the "host" of the group is). What I've mentioned is also not robust in the face of new phones leaving and joining the group, but there's clever ways you can work around that if you give it some thought. :)

Also, in the future, please post questions that are not related to the sample apps themselves on StackOverflow (tagged with https://stackoverflow.com/questions/tagged/google-nearby).

Good luck!

from android-nearby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.