Ditto 5.0.0
Loading...
Searching...
No Matches
DittoSDK.Transport Namespace Reference

Classes

struct  DittoConnection
 Represents a connection between two peers in a Ditto mesh network. More...
class  DittoConnectionRequest
 Contains information about a remote peer that has requested a connection. More...
struct  DittoPeer
 Represents a peer in a Ditto mesh network. More...
class  DittoPresence
 The entrypoint for all actions that relate presence of other peers known by the current peer, either directly or through other peers. More...
struct  DittoPresenceGraph
 Represent the states of all known peers. More...
class  DittoPresenceObserver
 A token returned by ObservePresence. Retain this object to continue receiving callback updates. More...
class  DittoRemotePeer
 A summary snapshot of the connections currently active with a remote peer. More...
class  DittoTransportConditionChangedEventArgs
 Data passed to the Ditto.DittoTransportConditionChanged event handler when the condition of one of the underlying transports that Ditto uses changes. More...
class  DittoTransportHandle
 Wrapper around an Action for cleaning up native transport resources. More...

Enumerations

enum  DittoConditionSource : uint {
  Bluetooth = 0 , Tcp = 1 , Awdl = 2 , Mdns = 3 ,
  WifiAware = 4
}
 The subsystem which is reporting a condition change.
enum  DittoConnectionRequestAuthorization { Allow , Deny }
 Indicates whether a connection request should be authorized. More...
enum  DittoConnectionType { Bluetooth , AccessPoint , P2PWiFi , WebSocket }
 The transport protocol used by two peers to communicate within a given connection.
enum  DittoPeerOS {
  Generic , iOS , tvOS , Android ,
  Linux , Windows , macOS , Unknown
}
 Represents the operating system of a peer in a Ditto mesh network. More...
enum  DittoTransportCondition : uint {
  Unknown = 0 , Ok = 1 , GenericFailure = 2 , AppInBackground = 3 ,
  MdnsFailure = 4 , TcpListenFailure = 5 , NoBleCentralPermission = 6 , NoBlePeripheralPermission = 7 ,
  CannotEstablishConnection = 8 , BleDisabled = 9 , NoBleHardware = 10 , WifiDisabled = 11 ,
  TemporarilyUnavailable = 12
}
 The different conditions that a transport can be in at a point in time.

Functions

record AwdlConfig ([property:JsonPropertyName("enabled")] bool Enabled=false)
 Configuration for Apple Wireless Direct Link (AWDL) network transport. Not supported on all platforms.
record BluetoothLEConfig ([property:JsonPropertyName("enabled")] bool Enabled=false)
 Configuration for Bluetooth Low Energy network transport. Not supported on all platforms (yet).
record DittoConnect ([property:JsonPropertyName("tcp_servers")] HashSet< string > TcpServers, [property:JsonPropertyName("websocket_urls")] HashSet< string > WebsocketUrls, [property:JsonPropertyName("retry_interval")] TimeSpan RetryInterval)
 Configuration for network transports used to connect with Ditto big peers.
record DittoGlobal ([property:JsonPropertyName("sync_group")] uint SyncGroup=0, [property:JsonPropertyName("routing_hint")] uint RoutingHint=DittoGlobal.NoPreferredRouteHint)
 Configuration for all network transports.
record DittoHttpListenConfig ([property:JsonPropertyName("enabled")] bool Enabled, [property:JsonPropertyName("interface_ip")] string InterfaceIp, [property:JsonPropertyName("port")] ushort Port, [property:JsonPropertyName("websocket_sync")] bool WebsocketSync, [property:JsonPropertyName("tls_key_path")] string TlsKeyPath, [property:JsonPropertyName("tls_certificate_path")] string TlsCertificatePath, [property:JsonPropertyName("identity_provider")] bool IdentityProvider, [property:JsonPropertyName("identity_provider_signing_key")] string IdentityProviderSigningKey, [property:JsonPropertyName("identity_provider_verifying_keys")] List< string > IdentityProviderVerifyingKeys, [property:JsonPropertyName("identity_provider_ca_key")] string IdentityProviderCAKey)
record DittoLanConfig ([property:JsonPropertyName("enabled")] bool Enabled=false, [property:JsonPropertyName("mdns_enabled")] bool MdnsEnabled=true, [property:JsonPropertyName("multicast_enabled")] bool MulticastEnabled=true)
 Configuration for local LAN Wi-Fi network transport.
record DittoListen ([property:JsonPropertyName("tcp")] DittoTcpListenConfig Tcp, [property:JsonPropertyName("http")] DittoHttpListenConfig Http)
 Configuration for network transports used to allow incoming connections from other Ditto peers.
record DittoPeerToPeer ([property:JsonPropertyName("lan")] DittoLanConfig Lan, [property:JsonPropertyName("awdl")] AwdlConfig Awdl, [property:JsonPropertyName("wifi_aware")] WifiAwareConfig WifiAware, [property:JsonPropertyName("bluetooth_le")] BluetoothLEConfig BluetoothLE)
 Configuration for network transport used to connect with other Ditto small peers. Some transports are not supported on all platforms.
record DittoTcpListenConfig ([property:JsonPropertyName("enabled")] bool Enabled=false, [property:JsonPropertyName("interface_ip")] string InterfaceIp="[::]", [property:JsonPropertyName("port")] ushort Port=4040)
 Configuration for less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of Listen can result in insecure configurations.
record DittoTransportConfig ([property:JsonPropertyName("peer_to_peer")] DittoPeerToPeer PeerToPeer, [property:JsonPropertyName("connect"), JsonConverter(typeof(DittoConnectConverter))] DittoConnect Connect, [property:JsonPropertyName("listen")] DittoListen Listen, [property:JsonPropertyName("global")] DittoGlobal Global)
 Configuration object specifying which network transports Ditto should use to sync data.
record WifiAwareConfig ([property:JsonPropertyName("enabled")] bool Enabled=false)
 Configuration for Wi-Fi Aware network transport. Not supported on all platforms.

Enumeration Type Documentation

◆ DittoConnectionRequestAuthorization

Indicates whether a connection request should be authorized.

Enumerator
Allow 

The connection request will be allowed.

Deny 

The connection request will be denied.

◆ DittoPeerOS

Represents the operating system of a peer in a Ditto mesh network.

Enumerator
Generic 

Generic or unspecified operating system.

iOS 

iOS operating system.

tvOS 

tvOS operating system.

Android 

Android operating system.

Linux 

Linux operating system.

Windows 

Windows operating system.

macOS 

macOS operating system.

Unknown 

Unknown operating system.

Function Documentation

◆ DittoTransportConfig()

record DittoSDK.Transport.DittoTransportConfig ( [property: JsonPropertyName("peer_to_peer")] DittoPeerToPeer PeerToPeer,
[property: JsonPropertyName("connect"), JsonConverter(typeof(DittoConnectConverter))] DittoConnect Connect,
[property: JsonPropertyName("listen")] DittoListen Listen,
[property: JsonPropertyName("global")] DittoGlobal Global )

Configuration object specifying which network transports Ditto should use to sync data.

A Ditto object comes with a default transport configuration where all available peer-to-peer transports are enabled. You can customize this by initializing a DittoTransportConfig, adjusting its properties, and supplying it to SetTransportConfig() on Ditto.

When you initialize a DittoTransportConfig yourself it starts with all transports disabled. You must enable each one directly.

Peer-to-peer transports will automatically discover peers in the vicinity and create connections without any configuration. These are configured inside the PeerToPeer property. To turn each one on, set its enabled property to true.

To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the Connect configuration. These are either host:port strings for raw TCP sync, or a wss://… URL for websockets.

The Listen configurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of Listen can result in insecure configurations.

Enables all peer-to-peer network transports supported on the current platform.