Session
Functions
Adds peers to connect to.
Binds the network listeners to the specified interfaces.
Creates a new repository.
Delete a repository with the given name.
Returns our Ouisync protocol version.
Returns the current DHT routers (bootstrap nodes). If the routers haven't been changed by the user yet, returns the default routers.
Returns the highest protocol version of all known peers.
Returns the listener addresses of this Ouisync instance.
Returns the listener addresses of the specified remote Ouisync instance. Works only if the remote control API is enabled on the remote instance. Typically used with cache servers.
Returns the runtime id of this Ouisync instance.
Returns the access mode that the given token grants.
Return the info-hash of the repository corresponding to the given token, formatted as hex string.
Returns the suggested name for the repository corresponding to the given token.
Initializes the network according to the stored configuration. If a particular network parameter is not yet configured, falls back to the given defaults.
Checks whether local DHT is enabled.
Is local discovery enabled?
Checks whether accepting peers discovered on the peer exchange is enabled.
Is port forwarding (UPnP) enabled?
Opens a side channel to the underlying IPv4 UDP socket. The side channel is used to send/receive raw UDP datagrams on the same socket that the sync protocol uses. This is useful to share the socket between different protocols for hole punching.
Opens a side channel to the underlying IPv6 UDP socket. The side channel is used to send/receive raw UDP datagrams on the same socket that the sync protocol uses. This is useful to share the socket between different protocols for hole punching.
Opens a raw byte streams to the given peer, bound to the given topic.
Opens an existing repository.
Removes peers previously added with Self::session_add_user_provided_peers.
Changes the DHT routers (bootstrap nodes), rebootstraps the DHTs and restart any ongoing lookups. If this is not called, a default set of routers is used. Each router is specified as hostname + port or ip address + port.
Set whether DHT on the local network or localhost is allowed. By default this is false because DHT is a global discovery mechanism and finding a local peer on it is unexpected (and could indicate malice). However, is some situations it's still useful to enable it (typically for testing).
Enables/disables local discovery.
Enables/disables port forwarding (UPnP).
Returns a Flow of network events.
Checks whether the given string is a valid share token.