<?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_socket_bind">


  <info>
    <link type="guide" xref="mongoc_socket_t" group="function"/>
  </info>
  <title>mongoc_socket_bind()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[int
mongoc_socket_bind (mongoc_socket_t       *sock,
                    const struct sockaddr *addr,
                    socklen_t              addrlen);
]]></code></synopsis>
  </section>


  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>sock</p></td><td><p>A <link xref="mongoc_socket_t">mongoc_socket_t</link>.</p></td></tr>
      <tr><td><p>addr</p></td><td><p>A struct sockaddr.</p></td></tr>
      <tr><td><p>addrlen</p></td><td><p>A socklen_t.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>This function is a wrapper around the BSD socket <code>bind()</code> interface. It provides better portability between UNIX-like and Microsoft Windows platforms.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p>0 on success, -1 on failure and errno is set.</p>
  </section>


</page>
