.\" Man page generated from reStructuredText. . .TH "MONGOC_TOPOLOGY_DESCRIPTION_HAS_READABLE_SERVER" "3" "Jun 04, 2021" "1.17.6" "libmongoc" .SH NAME mongoc_topology_description_has_readable_server \- mongoc_topology_description_has_readable_server() . .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 .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C bool mongoc_topology_description_has_readable_server ( mongoc_topology_description_t *td, const mongoc_read_prefs_t *prefs); .ft P .fi .UNINDENT .UNINDENT .sp Determines if the topology has a readable server available. Servers are filtered by the given read preferences only if the driver is connected to a replica set, otherwise the read preferences are ignored. This function uses the driver\(aqs current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O and it does not block. .sp Use this function in a topology\-changed callback registered with \fBmongoc_apm_set_topology_changed_cb\fP\&. For historical reasons, the \fBmongoc_topology_description_t\fP passed to the callback is a const pointer, you must cast away const to pass the pointer to \fBmongoc_topology_description_has_readable_server\fP\&. .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBtd\fP: A \fBmongoc_topology_description_t\fP\&. .IP \(bu 2 \fBread_prefs\fP: A \fBmongoc_read_prefs_t\fP or \fBNULL\fP for default read preferences. .UNINDENT .SH RETURNS .sp True if there is a known server matching \fBprefs\fP\&. .SH SEE ALSO .sp Introduction to Application Performance Monitoring .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .