.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MONGOC_CLIENT_GET_HANDSHAKE_DESCRIPTION" "3" "May 07, 2024" "1.27.1" "libmongoc" .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX mongoc_server_description_t * mongoc_client_get_handshake_description (mongoc_client_t *client, uint32_t server_id, bson_t *opts, bson_error_t *error) BSON_GNUC_WARN_UNUSED_RESULT; .EE .UNINDENT .UNINDENT .sp Returns a description constructed from the initial handshake response to a server. .SH DESCRIPTION .sp \fI\%mongoc_client_get_handshake_description()\fP is distinct from \fI\%mongoc_client_get_server_description()\fP\&. \fI\%mongoc_client_get_server_description()\fP returns a server description constructed from monitoring, which may differ from the server description constructed from the connection handshake. .sp \fI\%mongoc_client_get_handshake_description()\fP 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. .sp 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. .SS Single\-threaded client behavior .sp 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 \fI\%mongoc_client_get_handshake_description()\fP may still differ from the server description returned by \fI\%mongoc_client_get_server_description()\fP\&. Notably, if connected to a load balanced cluster, the server description returned by \fI\%mongoc_client_get_server_description()\fP will describe the load balancer server (\fI\%mongoc_server_description_type()\fP will return \(dqLoadBalancer\(dq). And the server description returned by \fI\%mongoc_client_get_handshake_description()\fP will describe the backing server. .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBclient\fP: A \fI\%mongoc_client_t\fP\&. .IP \(bu 2 \fBserver_id\fP: The ID of the server. This can be obtained from the server description of \fI\%mongoc_client_select_server()\fP\&. .IP \(bu 2 \fBopts\fP: Unused. Pass \fBNULL\fP\&. .IP \(bu 2 \fBerror\fP: An optional location for a \fI\%bson_error_t\fP or \fBNULL\fP\&. .UNINDENT .SH RETURNS .sp A \fI\%mongoc_server_description_t\fP that must be freed with \fI\%mongoc_server_description_destroy()\fP\&. If a connection has not been successfully established to a server, returns \fBNULL\fP and \fBerror\fP is filled out. .SH SEE ALSO .INDENT 0.0 .IP \(bu 2 \fI\%mongoc_client_select_server()\fP To select a server from read preferences. .IP \(bu 2 \fI\%mongoc_client_get_server_description()\fP To obtain the server description from monitoring for a server. .IP \(bu 2 \fI\%mongoc_server_description_type()\fP To obtain the type of server from a server description. .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .