diff --git a/include/lsquic.h b/include/lsquic.h index 848e3a37..a56314dd 100644 --- a/include/lsquic.h +++ b/include/lsquic.h @@ -1438,6 +1438,12 @@ lsquic_engine_packet_in (lsquic_engine_t *, const struct sockaddr *sa_local, const struct sockaddr *sa_peer, void *peer_ctx, int ecn); +/** + * Returns current number of connections processed by the engine. Both mini and full connections included + */ +unsigned +lsquic_engine_get_conns_count (lsquic_engine_t *engine); + /** * Process tickable connections. This function must be called often enough so * that packets and connections do not expire. diff --git a/src/liblsquic/lsquic_engine.c b/src/liblsquic/lsquic_engine.c index cfdc0c0c..9cdef9ce 100644 --- a/src/liblsquic/lsquic_engine.c +++ b/src/liblsquic/lsquic_engine.c @@ -2213,6 +2213,11 @@ drop_all_mini_conns (lsquic_engine_t *engine) cub_flush(&cub); } +unsigned +lsquic_engine_get_conns_count (lsquic_engine_t *engine) +{ + return engine->n_conns; +} void lsquic_engine_process_conns (lsquic_engine_t *engine)