<?xml version="1.0"?>

<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="mongoc_client_get_server_status">


  <info>
    <link type="guide" xref="mongoc_client_t" group="function"/>
  </info>
  <title>mongoc_client_get_server_status()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[bool
mongoc_client_get_server_status (mongoc_client_t     *client,
                                 mongoc_read_prefs_t *read_prefs,
                                 bson_t              *reply,
                                 bson_error_t        *error);]]></code></synopsis>
    <p>Queries the server for the current server status. The result is stored in <code>reply</code>.</p>
    <note style="warning"><p><code>reply</code> is always initialized, even in the case of failure. Always call <code xref="bson:bson_destroy">bson_destroy()</code> to release it.</p></note>
  </section>


  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>client</p></td><td><p>A <code xref="mongoc_client_t">mongoc_client_t</code>.</p></td></tr>
      <tr><td><p>read_prefs</p></td><td><p>A <code xref="mongoc_read_prefs_t">mongoc_read_prefs_t</code>.</p></td></tr>
      <tr><td><p>reply</p></td><td><p>A location for the result <code xref="bson:bson_t">bson_t</code>.</p></td></tr>
      <tr><td><p>error</p></td><td><p>An optional location for a <code xref="bson:bson_error_t">bson_error_t</code> or <code>NULL</code>.</p></td></tr>
    </table>
  </section>

  <section id="errors">
    <title>Errors</title>
    <p>Errors are propagated via the <code>error</code> parameter.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p><code>true</code> on success, otherwise <code>false</code> and <code>error</code> is set.</p>
  </section>

</page>
