Skip to content

Commit

Permalink
Incorporate tech review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dacharyc committed Nov 2, 2023
1 parent 4232352 commit 3e6814b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions source/sdk/swift/sync/sync-session.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,26 @@ Manually Reconnect All Sync Sessions

Realm automatically detects when a device regains connectivity after being
offline and attempts to reconnect using an incremental backoff strategy.
For example, on Apple platforms, Realm listens for network change notifications
and automatically triggers a reconnect immediately after receiving one.

In Swift SDK version 10.44.0 and later, you can choose to manually trigger a
reconnect attempt with ``SyncSession.reconnect()``
instead of waiting for the duration of the incremental backoff. This is
useful if you have a more accurate understanding of
the network conditions and don't want to rely on Realm's automatic
reconnect detection. The SDK also automatically calls this method when a device
toggles off airplane mode.
reconnect detection.

.. literalinclude:: /examples/generated/code/start/Sync.snippet.sync-session-reconnect.swift
:language: swift

When you call this method, the SDK forces all sync sessions to attempt to
reconnect immediately and resets any timers used for incremental
backoff.
When you call this method, the SDK forces all sync sessions to *attempt* to
reconnect immediately. This resets any timers used for incremental
backoff.

Calling this method does not guarantee the device can reconnect. If the SDK
gets a fatal error, or if the device is already connected or is trying to
connect, calling this method has no effect.

.. important:: Cannot Reconnect Within Socket Read Timeout Duration

Expand Down

0 comments on commit 3e6814b

Please sign in to comment.