The internal network loop must be called at a regular interval.
This is the plugin version 4 interface, which is exclusively for authentication and access control, and which is still supported for existing plugins.
This is the plugin version 5 interface, which covers authentication, access control, the $CONTROL topic space handling, and message inspection and modification.
libmosquitto provides thread safe operation, with the exception of mosquitto_lib_init which is not thread safe.