1=pod 2 3=head1 NAME 4 5DTLS_timer_cb, 6DTLS_set_timer_cb 7- Set callback for controlling DTLS timer duration 8 9=head1 SYNOPSIS 10 11 #include <openssl/ssl.h> 12 13 typedef unsigned int (*DTLS_timer_cb)(SSL *s, unsigned int timer_us); 14 15 void DTLS_set_timer_cb(SSL *s, DTLS_timer_cb cb); 16 17=head1 DESCRIPTION 18 19This function sets an optional callback function for controlling the 20timeout interval on the DTLS protocol. The callback function will be 21called by DTLS for every new DTLS packet that is sent. 22 23The callback should return the timeout interval in micro seconds. 24 25The I<timer_us> parameter of the callback is the last set timeout 26interval returned. On the first invocation of the callback, 27this value will be 0. 28 29At the beginning of the connection, if no timeout callback has been 30set via DTLS_set_timer_cb(), the default timeout value is 1 second. 31For all subsequent timeouts, the default behavior is to double the 32duration up to a maximum of 1 minute. 33 34=head1 RETURN VALUES 35 36Returns void. 37 38=head1 HISTORY 39 40The DTLS_set_timer_cb() function was added in OpenSSL 1.1.1. 41 42=head1 COPYRIGHT 43 44Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved. 45 46Licensed under the Apache License 2.0 (the "License"). You may not use 47this file except in compliance with the License. You can obtain a copy 48in the file LICENSE in the source distribution or at 49L<https://www.openssl.org/source/license.html>. 50 51=cut 52