gnutls_heartbeat_ping(3)
π gnutls_heartbeat_ping(3) π
okay bestie, welcome to the gnutls manual β yes, the whole thing, and yes, this page is the one about pinging your peer to check they're still alive. it's giving heartbeat check, it's giving "u up?" but for TLS. π«Ά
β¨ NAME β¨
gnutls_heartbeat_ping β an API function. that's it, that's the name, she's serving exactly what it says on the tin π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int gnutls_heartbeat_ping(gnutls_session_t session, size_t data_size,
unsigned int max_tries, unsigned int flags);
π ARGUMENTS π
gnutls_session_t sessionβ it's agnutls_session_ttype, bestie. the session. the moment. the whole vibe. πsize_t data_sizeβ the length of the ping payload, aka how much juice you're stuffing in there. πunsigned int max_triesβ ifflagsisGNUTLS_HEARTBEAT_WAIT, then this is the number of retransmissions. use zero for indefinite (which means, like, keep going until timeout β no cap fr fr). π₯unsigned int flagsβ if it'sGNUTLS_HEARTBEAT_WAITthen we wait for the pong or a timeout instead of just returning immediately. no waiting around like a loser otherwise. β
π¦ DESCRIPTION π¦
so this function sends a ping to the peer. that's the whole bit. π
if flags is set to GNUTLS_HEARTBEAT_WAIT, then it waits for a reply from the peer β like actually sits there, main character energy, until the pong comes home. π
heads up bestie!! it is highly recommended to use this function with the flag GNUTLS_HEARTBEAT_WAIT, or you're gonna have to handle retransmissions and timeouts manually. and nobody wants that. literally nobody. π
the total TLS data transmitted as part of the ping message is given by the following formula:
MAX(16, data_size)+gnutls_record_overhead_size()+3
that's the math, and the math ate. periodt. β¨
π RETURNS π
GNUTLS_E_SUCCESS on success, otherwise a negative error code. so like... if it's not that success value, something went wrong and it's telling you with a lil negative number. π
π SINCE π
3.1.2 β she's been iconic since 3.1.2, no cap. π
π REPORTING BUGS π
found a bug? don't be shy, tell the girlies:
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
(yes, you can copy it, you just gotta keep the receipts. iconic behaviour honestly. π )
π SEE ALSO π
The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form visit
https://www.gnutls.org/manual/
okay that's the whole page, you slayed it, go ping something responsibly π«Ά
later bestie β this was gnutls version 3.8.13, page gnutls_heartbeat_ping(3), mwah πβ¨π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms