SSL_get_event_timeout.pod 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. =pod
  2. =head1 NAME
  3. SSL_get_event_timeout - determine when an SSL object next needs to have events
  4. handled
  5. =head1 SYNOPSIS
  6. #include <openssl/ssl.h>
  7. int SSL_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite);
  8. =head1 DESCRIPTION
  9. SSL_get_event_timeout() determines when the SSL object next needs to perform
  10. internal processing due to the passage of time.
  11. All arguments are required; I<tv> and I<is_infinite> must be non-NULL.
  12. Upon the successful return of SSL_get_event_timeout(), one of the following
  13. cases applies:
  14. =over 4
  15. =item
  16. The SSL object has events which need to be handled immediately; The fields of
  17. I<*tv> are set to 0 and I<*is_infinite> is set to 0.
  18. =item
  19. The SSL object has events which need to be handled after some amount of time
  20. (relative to the time at which SSL_get_event_timeout() was called). I<*tv> is
  21. set to the amount of time after which L<SSL_handle_events(3)> should be called
  22. and I<*is_infinite> is set to 0.
  23. =item
  24. There are currently no timer events which require handling in the future. The
  25. value of I<*tv> is unspecified and I<*is_infinite> is set to 1.
  26. =back
  27. This function is currently applicable only to DTLS and QUIC connection SSL
  28. objects. If it is called on any other kind of SSL object, it always outputs
  29. infinity. This is considered a success condition.
  30. For DTLS, this function can be used instead of the older
  31. L<DTLSv1_get_timeout(3)> function. Note that this function differs from
  32. L<DTLSv1_get_timeout(3)> in that the case where no timeout is active is
  33. considered a success condition.
  34. Note that the value output by a call to SSL_get_event_timeout() may change as a
  35. result of other calls to the SSL object.
  36. Once the timeout expires, L<SSL_handle_events(3)> should be called to handle any
  37. internal processing which is due; for more information, see
  38. L<SSL_handle_events(3)>.
  39. Note that SSL_get_event_timeout() supersedes the older L<DTLSv1_get_timeout(3)>
  40. function for all use cases.
  41. If the call to SSL_get_event_timeout() fails, the values of I<*tv> and
  42. I<*is_infinite> may still be changed and their values become unspecified.
  43. =head1 RETURN VALUES
  44. Returns 1 on success and 0 on failure.
  45. =head1 SEE ALSO
  46. L<SSL_handle_events(3)>, L<DTLSv1_get_timeout(3)>, L<ssl(7)>
  47. =head1 HISTORY
  48. The SSL_get_event_timeout() function was added in OpenSSL 3.2.
  49. =head1 COPYRIGHT
  50. Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
  51. Licensed under the Apache License 2.0 (the "License"). You may not use
  52. this file except in compliance with the License. You can obtain a copy
  53. in the file LICENSE in the source distribution or at
  54. L<https://www.openssl.org/source/license.html>.
  55. =cut