libwebsockets
Lightweight C library for HTML5 websockets
|
lws_conmon
apis LWS_WITH_CONMON
build option enables lws_conmon
apis for user code... these add some staticistic and information to client connections that can use useful for devices to introspect how the connection to their servers is actually performing.
The public apis can be found in libwebsockets/lws-conmon.h
.
A struct is provided that describes
Because the user code may want to hold on to the DNS list for longer than the life of the wsi that originated it, the lws_conmon_wsi_take()
api allows the ownership of the allocated list to be transferred to the user code (as well as copying data out into the user's struct so it no longer has any dependency on wsi lifetime either). The DNS list copy in the struct must be released at some point by calling lws_conmon_release()
, but that can be at any time afterwards.
The lws-minimal-http-client example shows how user code can use the apis, build lws with the LWS_WITH_CONMON
cmake option and run with --conmon
to get a dump of the collected information.