setPriorityForMeshRole

fun setPriorityForMeshRole(priority: DittoConnectionPriority, meshRole: UByte, ditto: Ditto)

Upcoming SDK feature made available for prototyping.

Configures the priority with which the local Ditto instance will connect to any remote peers of the given mesh role.

Connections can be established in either direction, so the remote peers might attempt connections to this Ditto with different priorities unless they are similarly configured.

While mesh roles offer the most flexibility in establishing connection priorities, a similar concept called "Sync Groups" exists. See the syncGroup property in the global config (live.ditto.dittotransports.DittoGlobalConfig) for more info. In general, you should start with mesh roles as they offer more control than sync groups.

Note: Mesh roles are not a security mechanism. A peer may change its role at runtime for any reason. Mesh roles are used only to influence the shape of the mesh which Ditto creates or to serve as targets for multihop sync.

Parameters

priority

The priority with which outgoing connections should be attempted.

meshRole

The mesh role of any remote peers to which we should not attempt to connect. Must be between 0 and 63 (inclusive).

ditto

The local Ditto instance.