You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_client_get_handshake_description.rst
+4-11Lines changed: 4 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -21,21 +21,14 @@ Description
21
21
22
22
:symbol:`mongoc_client_get_handshake_description` is distinct from :symbol:`mongoc_client_get_server_description`. :symbol:`mongoc_client_get_server_description` returns a server description constructed from monitoring, which may differ from the server description constructed from the connection handshake.
23
23
24
-
Use this function only for building a language driver that wraps the C Driver. When writing applications in C, higher-level functions automatically select a suitable server.
24
+
:symbol:`mongoc_client_get_handshake_description` will attempt to establish a connection to the server if a connection was not already established. It will perform the MongoDB handshake and authentication if required.
25
25
26
-
:symbol:`mongoc_client_get_handshake_description` does not attempt to establish a connection to the server if a connection was not already established. If a connection has not been established, this returns ``NULL`` and sets ``error``.
26
+
Use this function only for building a language driver that wraps the C Driver. When writing applications in C, higher-level functions automatically select a suitable server.
27
27
28
28
Single-threaded client behavior
29
29
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
-
To ensure a connection has been established ensure that the server is selectable (e.g. by calling :symbol:`mongoc_client_select_server`) or that an operation has successfully run on the server (e.g. by sending "ping").
31
-
32
-
If the established connection has not completed authentication, calling :symbol:`mongoc_client_get_handshake_description` will complete authentication on the connection.
33
-
34
-
Single-threaded clients only have one active connection to each server. The one connection is used for both monitoring and application operations. However, the server description returned by :symbol:`mongoc_client_get_handshake_description` may still differ from :symbol:`mongoc_client_get_server_description`. Notably, if connected to a load balanced cluster, the :symbol:`mongoc_client_get_server_description` will describe the load balancer server (:symbol:`mongoc_server_description_type` will return "LoadBalancer"). And :symbol:`mongoc_client_get_handshake_description` will describe the backing server.
35
30
36
-
Pooled client behavior
37
-
^^^^^^^^^^^^^^^^^^^^^^
38
-
To ensure a connection has been established ensure an operation has successfully run on a server (e.g. by sending "ping").
31
+
Single-threaded clients only have one active connection to each server. The one connection is used for both monitoring and application operations. However, the server description returned by :symbol:`mongoc_client_get_handshake_description` may still differ from the server description returned by :symbol:`mongoc_client_get_server_description`. Notably, if connected to a load balanced cluster, the :symbol:`mongoc_client_get_server_description` will describe the load balancer server (:symbol:`mongoc_server_description_type` will return "LoadBalancer"). And :symbol:`mongoc_client_get_handshake_description` will describe the backing server.
39
32
40
33
Parameters
41
34
----------
@@ -48,7 +41,7 @@ Parameters
48
41
Returns
49
42
-------
50
43
51
-
A :symbol:`mongoc_server_description_t` that must be freed with :symbol:`mongoc_server_description_destroy`. If a connection has not been successfully established to a server, returns NULL and ``error`` is filled out.
44
+
A :symbol:`mongoc_server_description_t` that must be freed with :symbol:`mongoc_server_description_destroy`. If a connection has not been successfully established to a server, returns ``NULL`` and ``error`` is filled out.
0 commit comments