Skip to content

Instantly share code, notes, and snippets.

@Raynos

Raynos/x.md Secret

Created January 8, 2013 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/9883f3f732a12a887d85 to your computer and use it in GitHub Desktop.
Save Raynos/9883f3f732a12a887d85 to your computer and use it in GitHub Desktop.

history exchange

  • 10 nodes all connected to a single echo server (multi-cast)
  • node #11 joins and broadcasts a history exchange request ({ id: myself, uuid: uuid() })
  • nodes 1-10 all try to connect to central relay server on /relay/request.id/request.uuid
  • relay server enforces that only one node can connect to that URL and closes the other 9 connections
  • node #11 connects to central relay server on /relay/request.uuid/request.id
  • central relay server connects node #11 with the random node that won the race.
  • history is exchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment