-
- All Implemented Interfaces:
-
kotlin.Cloneable
public final class DittoTransportConfig extends DittoTransportConfig implements Cloneable
A configuration object specifying which network transports Ditto should use to sync data.
A
Dittoobject comes with a default transport configuration where all available peer-to-peer transports are enabled. You can customize this by initializing aDittoTransportConfig, adjusting its properties, and supplying it tosetTransportConfig()onDitto.When you initialize a
DittoTransportConfigyourself 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
peerToPeerproperty. To turn each one on, set its enabled property totrue.To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the
connectconfiguration. These are either "host:port" strings for raw TCP sync, or a "wss://…" URL for websockets.The
listenconfigurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use oflistencan result in insecure configurations.
-
-
Field Summary
Fields Modifier and Type Field Description private DittoPeerToPeerpeerToPeerprivate DittoConnectconnectprivate DittoListenlistenprivate DittoGlobalConfigglobal
-
Constructor Summary
Constructors Constructor Description DittoTransportConfig(DittoPeerToPeer peerToPeer, DittoConnect connect, DittoListen listen, DittoGlobalConfig global)
-
Method Summary
Modifier and Type Method Description final DittoPeerToPeergetPeerToPeer()final UnitsetPeerToPeer(DittoPeerToPeer peerToPeer)DittoConnectgetConnect()UnitsetConnect(DittoConnect connect)DittoListengetListen()UnitsetListen(DittoListen listen)DittoGlobalConfiggetGlobal()UnitsetGlobal(DittoGlobalConfig global)UnitenableAllPeerToPeer()DittoTransportConfigclone()-
-
Constructor Detail
-
DittoTransportConfig
DittoTransportConfig(DittoPeerToPeer peerToPeer, DittoConnect connect, DittoListen listen, DittoGlobalConfig global)
-
-
Method Detail
-
getPeerToPeer
final DittoPeerToPeer getPeerToPeer()
-
setPeerToPeer
final Unit setPeerToPeer(DittoPeerToPeer peerToPeer)
-
getConnect
DittoConnect getConnect()
-
setConnect
Unit setConnect(DittoConnect connect)
-
getListen
DittoListen getListen()
-
setListen
Unit setListen(DittoListen listen)
-
getGlobal
DittoGlobalConfig getGlobal()
-
setGlobal
Unit setGlobal(DittoGlobalConfig global)
-
enableAllPeerToPeer
Unit enableAllPeerToPeer()
-
clone
DittoTransportConfig clone()
-
-
-
-