MyQttConn * myqtt_tls_conn_new6 ( MyQttCtx ctx,
const char *  client_identifier,
axl_bool  clean_session,
int  keep_alive,
const char *  host,
const char *  port,
MyQttConnOpts opts,
MyQttConnNew  on_connected,
axlPointer  user_data 

Allows to create a new MQTT connection to a MQTT broker/server securing first the connection with TLS (MQTT over TLS), forcing IPv6 transport.

You must call myqtt_tls_init first before creating any connection.

ctxThe context where the operation will take place.
client_identifierThe client identifier that uniquely identifies this MQTT client from others. It can be NULL to let MQTT 3.1.1 servers to assign a default client identifier BUT clean_session must be set to axl_true. This is done automatically by the library (setting clean_session to axl_true when NULL is provided).
clean_sessionFlag to clean client session or to reuse the existing one. If set to axl_false, you must provide a valid client_identifier (otherwise the function will fail).
keep_aliveKeep alive configuration in seconds after which the server/broker will close the connection if it doesn't detect any activity. Setting 0 will disable keep alive mechanism.
hostThe location of the MQTT server/broker
portThe port of the MQTT server/broker
optsOptional connection options. See myqtt_conn_opts_new
on_connectedAsync notification handler that will be called once the connection fails or it is completed. In the case this handler is configured the caller will not be blocked. In the case this parameter is NULL, the caller will be blocked until the connection completes or fails.
user_dataUser defined pointer that will be passed to the on_connected handler (in case it is defined).
A reference to the newli created connection or NULL if on_connected handler is provided. In both cases, the reference returned (or received at the on_connected handler) must be checked with myqtt_conn_is_ok.

About pending messages / queued messages

After successful connection with clean_session set to axl_false and defined client identifier, the library will resend any queued or in flight QoS1/QoS2 messages (as well as QoS0 if they were stored). This is done in background without intefering the caller.

If you need to get the number of queued messages that are going to be sent use myqtt_storage_queued_messages_offline. In the case you need the number remaining during the process use myqtt_storage_queued_messages.

References MYQTT_IPv6.