@@ -50,68 +50,3 @@ method. The following example sets the LogLevel and the request timeout:
50
50
You can create multiple App client instances to connect to multiple
51
51
Apps. All App client instances that share the same App ID use the same
52
52
underlying connection.
53
-
54
- .. _dotnet-connect-to-specific-server:
55
-
56
- Connect to a Specific Server
57
- ----------------------------
58
-
59
- By default, Atlas Device SDK connects to Atlas using the global ``baseURL``
60
- of ``https://services.cloud.mongodb.com``. In some cases, you may want to
61
- connect to a different server:
62
-
63
- - Your App Services App uses :ref:`local deployment <local-deployment>`, and
64
- you want to connect directly to a local ``baseURL`` in your region.
65
-
66
- You can specify a ``baseURL`` in the
67
- :dotnet-sdk:`AppConfiguration <reference/Realms.Sync.AppConfiguration.html#Realms_Sync_AppConfiguration_BaseUri>`.
68
-
69
- .. literalinclude:: /examples/generated/dotnet/BaseURLChange.snippet.custom-base-url.cs
70
- :language: csharp
71
-
72
- Connect to a Different Server During Runtime
73
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
-
75
- .. versionadded:: 12.1.0
76
-
77
- In some cases, you might want to change the ``baseURL`` while the app is
78
- running. To change
79
- the ``baseURL`` during runtime, call the
80
- :dotnet-sdk:`app.UpdateBaseUriAsync() <reference/Realms.Sync.App.html#Realms_Sync_App_UpdateBaseUriAsync_System_Uri_>`
81
- method:
82
-
83
- .. literalinclude:: /examples/generated/dotnet/BaseURLChange.snippet.update-base-url.cs
84
- :language: csharp
85
-
86
- This API is experimental. As seen above, you must use ``#pragma warning disable Rlm001``
87
- and ``#pragma warning restore Rlm001`` to suppress the experimental errors,
88
- where ``Rlm001`` is the experimental attributes's ``diagnosticId``.
89
-
90
- If you want to change the ``baseURL`` after you have logged in a user and
91
- have opened a synced database, the app must perform a
92
- :ref:`client reset <dotnet-client-resets>`. Perform these steps in your code:
93
-
94
- 1. :ref:`Pause the Sync session <dotnet-suspend-resume-sync>`.
95
- 2. Update the ``baseURL`` by calling the ``app.updateBaseUrl(to: )`` method.
96
- 3. Authenticate and log the user in again with the new ``baseURL``.
97
- 4. Open a synced database pulling data from the new server.
98
-
99
- Both the server and the client must be online for the user to authenticate and
100
- connect to the new server. If the server is not online or the client does not
101
- have a network connection, the user cannot authenticate and open the database.
102
-
103
- .. important:: Changing an App Config After Initializing the App
104
-
105
- .. versionchanged:: v11.7.0
106
- ``BaseUri`` is not cached in the App configuration
107
-
108
- When you initialize the App client, the configuration is cached internally.
109
- Attempting to close and then re-open an App with a changed configuration
110
- within the same process has no effect. The client continues to use the
111
- cached configuration.
112
-
113
- In .NET SDK version 11.7.0 and later, the :dotnet-sdk:`BaseUri <reference/Realms.Sync.AppConfiguration.html#Realms_Sync_AppConfiguration_BaseUri>`
114
- is *no longer* cached in the App configuration. This means that you can change the
115
- ``BaseUri``, and the App client will use the updated configuration. In
116
- earlier SDK versions, changes to the ``BaseUri`` in a cached App
117
- configuration have no effect.
0 commit comments