Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.44 KB

nng_mqtt_set_cb.3.adoc

File metadata and controls

49 lines (35 loc) · 1.44 KB

nng_mqtt_callback_functions(3)

NAME

nng_mqtt_set_connect_cb - mqtt client connect callback function.

nng_mqtt_set_disconnect_cb - mqtt client disconnect callback function.

SYNOPSIS

#include <nng/mqtt/mqtt_client.h>

int nng_mqtt_set_connect_cb(nng_socket s, nng_pipe_cb cb, void *arg);
int nng_mqtt_set_disconnect_cb(nng_socket s, nng_pipe_cb cb, void *arg);

DESCRIPTION

nng_mqtt_set_xxx_cb() functions register the callback function cb to be called after the connection was established or disconnected. The callback cb will be passed arg as its final argument.

RETURN VALUES

This function returns 0 on success, and non-zero otherwise.

ERRORS

NNG_ECLOSED

The socket s does not refer to an open socket.