zookeeper_init

\brief create a handle to used communicate with zookeeper.

This method creates a new handle and a zookeeper session that corresponds to that handle. Session establishment is asynchronous, meaning that the session should not be considered established until (and unless) an event of state ZOO_CONNECTED_STATE is received. \param host comma separated host:port pairs, each corresponding to a zk server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" \param fn the global watcher callback function. When notifications are triggered this function will be invoked. \param clientid the id of a previously established session that this client will be reconnecting to. Pass 0 if not reconnecting to a previous session. Clients can access the session id of an established, valid, connection by calling \ref zoo_client_id. If the session corresponding to the specified clientid has expired, or if the clientid is invalid for any reason, the returned zhandle_t will be invalid -- the zhandle_t state will indicate the reason for failure (typically ZOO_EXPIRED_SESSION_STATE). \param context the handback object that will be associated with this instance of zhandle_t. Application can access it (for example, in the watcher callback) using \ref zoo_get_context. The object is not used by zookeeper internally and can be null. \param flags reserved for future use. Should be set to zero. \return a pointer to the opaque zhandle structure. If it fails to create a new zhandle the function returns NULL and the errno variable indicates the reason.

extern (C)
zookeeper_init
(
const char* host
,,,,
void* context
,
int flags
)

Meta