Skip to content

Commit

Permalink
Don’t allow reachability for P2P / loopback
Browse files Browse the repository at this point in the history
P2P may not need it, and loopback doesn’t make sense on iOS
  • Loading branch information
borrrden committed Oct 27, 2018
1 parent 6ce8317 commit 9aebf28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Couchbase.Lite.Shared/API/Sync/Replicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,14 @@ private void StartReachabilityObserver()
return;
}

var remoteUrl = (Config.Target as URLEndpoint)?.Url;
if(remoteUrl == null) {
return;
}

_reachability = Service.GetInstance<IReachability>() ?? new Reachability();
_reachability.StatusChanged += ReachabilityChanged;
_reachability.Url = Config.RemoteUrl;
_reachability.Url = remoteUrl;
_reachability.Start();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void Start()
{
_queue.DispatchSync(() =>
{
if (_started) {
if (_started || Url?.IsLoopback == true) {
return;
}
Expand Down

0 comments on commit 9aebf28

Please sign in to comment.