Name

lcb_get_host — Get information about the configuration stream

Synopsis

cc [ flag … ] file… -lcouchbase [ library … ]

#include <libcouchbase/couchbase.h>
const void * lcb_get_port(lcb_t instance);
const void * lcb_get_host(lcb_t instance);

DESCRIPTION

These functions may be used to get information about the configuration stream the instance is currently connected to over REST.

RETURN VALUES

The lcb_get_host() function returns the hostname of the server in use.

The lcb_get_port() function returns the port number of the server in use.

EXAMPLES

#include <libcouchbase/couchbase.h>
...
lcb_t instance;
...
fprintf(stdout, "Currently using %s:%s\n",
        lcb_get_host(instance), lcb_get_port(instance));
...

ATTRIBUTES

See lcb_attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE

Interface Stability

Committed

MT-Level

MT-Safe

COPYRIGHT

Copyright 2010-2013 Couchbase, Inc.

SEE ALSO

Learn more at http://www.couchbase.com/communities/c.

libcouchbase(3lib), lcb_create(3couchbase), lcb_attributes(5)