coast-team / netflux

JavaScript client and server side transport API based on WebRTC & WebSocket
https://coast-team.github.io/netflux
GNU Affero General Public License v3.0
213 stars 14 forks source link

Do not allow a new member if he did not respect network topology #46

Closed kalitine closed 6 years ago

kalitine commented 7 years ago

Current Behavior We consider only the full mesh topology. For example:

A----B
 \  /
   C

A, B, C are together in a peer to peer network. Each is connected with each other. D wants to join them, thus he should establish a connection with A, B and C. D failed to connect to C and succeed with A and B. The current network looks like this:

  C---------A---------D
  |         |         |
  +---------B---------+

From A and B point of view the network is composed of : A, B, C and D From C point of view the network is composed of : A, B and C From D point of view the network is composed of : A, B and D

Expected Behavior After D tried to join, the network should stay intact:

A----B
 \  /
   C

From A, B and C point of view the network is composed of : A, B, C From D point of view: he failed to join (next step may be try again, abandon...)

kalitine commented 6 years ago

Applied different strategy. Instead accept the fact that some connections may not be created (saw during some tests). Suppose that it is still a rare case (by experience), thus the likelihood that the network becomes split is law.