Browse files

update connection docs to cover unix sockets

  • Loading branch information...
1 parent 2d3293a commit 44a3c851cd3364604baa4dda94de4d3c03e69b35 @zhemao zhemao committed Jul 5, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 docs/source/sphinx/source/connections.rst
@@ -25,6 +25,15 @@ Notice that when specifying the host, we must use dot-decimal notation. If you'd
to use a hostname, then you'll have to compile the driver with the ``--use-platform=LINUX``
option and ensure that ``_MONGO_USE_GETADDRINFO`` is defined.
+The C driver now also supports connecting to mongodb through unix domain
+sockets (only on POSIX systems, of course). To connect to a unix domain socket,
+pass the path to the socket in place of the host address to ``mongo_connect``
+and pass a negative number in as the port number. For instance,
+.. code-block:: c
+ result = mongo_connect( conn, "/tmp/mongodb-27017.sock", -1 );
In the event of an error, the result will be ``MONGO_ERROR``. You can then check the error
value by examining the connection's ``err`` field. Continuing:

0 comments on commit 44a3c85

Please sign in to comment.