Skip to content

Mesh Network

Nick 닉 edited this page Jun 1, 2015 · 3 revisions

ServerInterconnect supports a "plug 'n play" style mesh network configuration. In a Mesh, there is no defined server as every connected entity is directly connected to every other entity. Data is sent to everyone not just to a server, therefore no information pertaining to an individual entity should be transmitted using this method. An authenticated mesh network is also available.

Mesh networks, by nature, can automatically be rebuilt quickly after a network failure, and since there is no defined host, entities can join and leave without consequence.

When creating a mesh network, you must give it a port and a list of IP addresses that are part of this mesh network.

Mesh mesh = new Mesh(1337, "ip#1", "ip#2", "etc.");

Then initialize the mesh:

mesh.initialize();

To send packets, call the broadcast() method:

mesh.getManager().broadcast(new JsonMessagePacket("Hey guys! Its me!"));

Clone this wiki locally