Session
The entry point to the ouisync library.
Example usage
// Create a session and initialize networking:
val session = Session.create("path/to/config/dir")
session.initNetwork()
session.bind(quicV4 = "0.0.0.0:0", quicV6 = "[::]:0")
// ...
// When done, close it:
session.close()
Functions
Adds a peer to connect to.
Binds the network listeners to the specified interfaces.
Returns our Ouisync protocol version.
Returns the highest protocol version of all known peers. If this is higher than our version it likely means we are using an outdated version of Ouisync. When a peer with higher protocol version is found, a NetworkEvent.PROTOCOL_VERSION_MISMATCH is emitted.
Initializes the network according to the stored config. If no config exists, falls back to the given parameters.
Is local discovery enabled?
Is port forwarding (UPnP) enabled?
Returns the interface the QUIC IPv4 listener is bound to, if any.
Returns the interface the QUIC IPv6 listener is bound to, if any.
Removes a peer previously added with addUserProvidedPeer
Enable/disable local discovery
Enable/disable port forwarding (UPnP)
Subscribe to the network events.
Returns the interface the TCP IPv4 listener is bound to, if any.
Returns the interface the TCP IPv6 listener is bound to, if any.
Returns the runtime id of this Ouisync instance.