Ditto
1.0.1
|
The entrypoint to the Ditto SDK. More...
Public Member Functions | |
unsafe | Ditto (DittoIdentity identity=default, string workingDir="ditto") |
Initializes a new instance of the Ditto class. More... | |
void | StartSync () |
Starts the network transports. Ditto will connect to other devices. More... | |
void | StopSync () |
Stops all network transports. More... | |
void | SetTransportConfig (DittoTransportConfig config) |
Assign a new transports configuration. By default peer-to-peer transports are enabled. More... | |
unsafe void | SetAccessLicense (string license) |
Activate a Ditto instance by setting an access license. You cannot interact with Ditto before you have activated it. More... | |
DittoTransportDiagnostics | TransportDiagnostics () |
Request bulk status information about the transports. This is mostly intended for statistical or debugging purposes. More... | |
DittoPeersObserver | ObservePeers (Action< List< DittoRemotePeer >> callback) |
Request information about Ditto peers in range of this device. This method returns an observer which should be held as long as updates are required. A newly registered observer will have a peers update delivered to it immediately. From then on it will be invoked repeatedly when Ditto devices come and go, or the active connections to them change. More... | |
Properties | |
bool | Activated [get] |
Gets a value indicating whether or not the SDK has been activated. More... | |
unsafe ulong | SiteId [get] |
Gets the unique identifier of a peer in Ditto's distributed mesh network. More... | |
DittoStore | Store [get] |
Gets a reference to the embedded data store. More... | |
unsafe string | SDKVersion [get] |
Gets a string identifying the version of the Ditto SDK. More... | |
The entrypoint to the Ditto SDK.
For a Ditto
instance to continue to connect to other devices it must be kept in scope.
|
inline |
|
inline |
Request information about Ditto peers in range of this device. This method returns an observer which should be held as long as updates are required. A newly registered observer will have a peers update delivered to it immediately. From then on it will be invoked repeatedly when Ditto devices come and go, or the active connections to them change.
callback | The Action that will be invoked when there is a presence update. |
DittoPeersObserver
instance, which must be retained to continue receiving callback updates.
|
inline |
|
inline |
Assign a new transports configuration. By default peer-to-peer transports are enabled.
You may use this method to alter the configuration at any time, however sync will not begin until startSync()
is called.
config | The new configuration to apply. |
|
inline |
|
inline |
Stops all network transports.
You may continue to use the database locally but no data will sync to or from other devices.
|
inline |
Request bulk status information about the transports. This is mostly intended for statistical or debugging purposes.
DittoTransportDiagnostics
that represents the current state of the network transports that the SDK is using.
|
get |
Gets a value indicating whether or not the SDK has been activated.
If false
then you need to call Ditto.SetAccessLicense(string) before interacting with the SDK.
|
get |
|
get |
Gets the unique identifier of a peer in Ditto's distributed mesh network.
IMPORTANT: This must be unique or the merging and conflict resolution will have unexpected behavior.
|
get |
Gets a reference to the embedded data store.