libwebsockets
Lightweight C library for HTML5 websockets
|
Data Structures | |
struct | lws_conmon |
union | lws_conmon.protocol_specific |
struct | lws_conmon.protocol_specific.http |
Typedefs | |
typedef uint32_t | lws_conmon_interval_us_t |
typedef enum lws_conmon_pcol | lws_conmon_pcol_t |
typedef enum lws_conmon_dns_disposition | lws_conmon_dns_disposition_t |
Enumerations | |
enum | lws_conmon_pcol { LWSCONMON_PCOL_NONE , LWSCONMON_PCOL_HTTP } |
enum | lws_conmon_dns_disposition { LWSCONMON_DNS_NONE , LWSCONMON_DNS_OK = 1 , LWSCONMON_DNS_SERVER_UNREACHABLE = 2 , LWSCONMON_DNS_NO_RESULT = 3 } |
Functions | |
LWS_VISIBLE LWS_EXTERN void | lws_conmon_wsi_take (struct lws *wsi, struct lws_conmon *dest) |
LWS_VISIBLE LWS_EXTERN void | lws_conmon_release (struct lws_conmon *conmon) |
When LWS_WITH_CONMON is enabled at build, collects detailed statistics about the client connection setup latency, available to the connection itself
struct lws_conmon |
Definition at line 81 of file lws-conmon.h.
Data Fields | ||
---|---|---|
lws_sockaddr46 | peer46 |
The peer we actually connected to, if any. .peer46.sa4.sa_family is either 0 if invalid, or the AF_ |
union lws_conmon | protocol_specific |
possibly-present protocol-specific additional information. This is only valid for the first transaction after connection and does not capture results for persistent or muxed connections like ws messages, mqtt messages, or h2 streams |
struct addrinfo * | dns_results_copy |
NULL, or Allocated copy of dns results, owned by this object and freed when object destroyed. Only set if client flag LCCSCF_CONMON applied |
lws_conmon_interval_us_t | ciu_dns |
0, or if a socket connection, us taken to acquire this DNS response |
lws_conmon_interval_us_t | ciu_sockconn |
0, or if connection-based, the us interval between the socket connect() attempt that succeeded, and the connection setup |
lws_conmon_interval_us_t | ciu_tls |
0 if no tls, or us taken to establish the tls tunnel |
lws_conmon_interval_us_t | ciu_txn_resp |
0, or if the protocol supports transactions, the interval between sending the initial transaction request and starting to receive the response |
lws_conmon_pcol_t | pcol |
indicates which extra protocol_specific info member is valid, if any |
lws_conmon_dns_disposition_t | dns_disposition |
indicates general disposition of DNS request |
union lws_conmon.protocol_specific |
Definition at line 86 of file lws-conmon.h.
Data Fields | ||
---|---|---|
protocol_specific | http |
struct lws_conmon.protocol_specific.http |
Definition at line 87 of file lws-conmon.h.
Data Fields | ||
---|---|---|
int | response |
h1 http response code |
typedef uint32_t lws_conmon_interval_us_t |
#include <include/libwebsockets/lws-conmon.h>
Definition at line 35 of file lws-conmon.h.
typedef enum lws_conmon_pcol lws_conmon_pcol_t |
#include <include/libwebsockets/lws-conmon.h>
typedef enum lws_conmon_dns_disposition lws_conmon_dns_disposition_t |
#include <include/libwebsockets/lws-conmon.h>
enum lws_conmon_pcol |
#include <include/libwebsockets/lws-conmon.h>
Enumerator | |
---|---|
LWSCONMON_PCOL_NONE | |
LWSCONMON_PCOL_HTTP |
Definition at line 65 of file lws-conmon.h.
#include <include/libwebsockets/lws-conmon.h>
Definition at line 70 of file lws-conmon.h.
LWS_VISIBLE LWS_EXTERN void lws_conmon_wsi_take | ( | struct lws * | wsi, |
struct lws_conmon * | dest | ||
) |
#include <include/libwebsockets/lws-conmon.h>
lws_conmon_wsi_take() - create a connection latency object from client wsi
context | lws wsi |
dest | conmon struct to fill |
Copies wsi conmon data into the caller's struct. Passes ownership of any allocations in the addrinfo list to the caller, lws will not delete that any more on wsi close after this call. The caller must call lws_conmon_release() on the struct to destroy any addrinfo in the struct that is prepared by this eventually but it can defer it as long as it wants.
Other than the addrinfo list, the contents of the returned object are completely selfcontained and don't point outside of the object itself, ie, everything else in there remains in scope while the object itself does.
LWS_VISIBLE LWS_EXTERN void lws_conmon_release | ( | struct lws_conmon * | conmon | ) |
#include <include/libwebsockets/lws-conmon.h>
lws_conmon_release() - free any allocations in the conmon struct
conmon | pointer to conmon struct |
Destroys any allocations in the conmon struct so it can go out of scope. It doesn't free dest
itself, it's designed to clean out a struct that is on the stack or embedded in another object.