diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-09-08 23:26:43 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-09-09 00:06:47 -0700 |
| commit | 846e3c1ae4277b1a826245bc683f2aa48cefa9bc (patch) | |
| tree | 92e621ae1c9ecef67507b8b48e99c4bb452c9480 /src | |
| parent | c17d1cfebc016ed790df74f0eeb539a4a71fadda (diff) | |
| download | nng-846e3c1ae4277b1a826245bc683f2aa48cefa9bc.tar.gz nng-846e3c1ae4277b1a826245bc683f2aa48cefa9bc.tar.bz2 nng-846e3c1ae4277b1a826245bc683f2aa48cefa9bc.zip | |
Bump socket common socket stats for PUB
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp/protocol/pubsub0/pub.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sp/protocol/pubsub0/pub.c b/src/sp/protocol/pubsub0/pub.c index 8d4f8ae2..abc52205 100644 --- a/src/sp/protocol/pubsub0/pub.c +++ b/src/sp/protocol/pubsub0/pub.c @@ -35,6 +35,7 @@ static void pub0_pipe_fini(void *); // pub0_sock is our per-socket protocol private structure. struct pub0_sock { + nni_sock *sock; nni_list pipes; nni_mtx mtx; bool closed; @@ -80,6 +81,7 @@ pub0_sock_init(void *arg, nni_sock *ns) nni_mtx_init(&sock->mtx); NNI_LIST_INIT(&sock->pipes, pub0_pipe, node); sock->sendbuf = 16; // fairly arbitrary + sock->sock = ns; #if NNG_ENABLE_STATS static const nni_stat_info tx_direct_info = { @@ -307,6 +309,7 @@ pub0_sock_send(void *arg, nni_aio *aio) if (direct == 0 && queued == 0) { dropped++; // we didn't find a pipe to send it to! } + nni_sock_bump_tx(sock->sock, len); nni_stat_inc(&sock->stat_tx_discard, dropped); nni_stat_inc(&sock->stat_tx_queued, queued); nni_stat_inc(&sock->stat_tx_direct, direct); |
