]>
Commit | Line | Data |
---|---|---|
bcbb30af DDO |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
5 | BIO_socket_wait, | |
6 | BIO_wait, | |
7 | BIO_connect_retry | |
8 | - BIO socket utility functions | |
9 | ||
10 | =head1 SYNOPSIS | |
11 | ||
12 | #include <openssl/bio.h> | |
13 | ||
14 | int BIO_socket_wait(int fd, int for_read, time_t max_time); | |
15 | int BIO_wait(BIO *bio, time_t max_time); | |
16 | int BIO_connect_retry(BIO *bio, long timeout); | |
17 | ||
18 | =head1 DESCRIPTION | |
19 | ||
20 | BIO_socket_wait() waits on the socket B<fd> for reading if B<for_read> is not 0, | |
21 | else for writing, at most until B<max_time>. | |
22 | It succeeds immediately if B<max_time> == 0 (which means no timeout given). | |
23 | ||
24 | BIO_wait() waits on the socket underlying the given B<bio>, for reading if | |
25 | B<bio> is supposed to read, else for writing, at most until B<max_time>. | |
26 | It succeeds immediately if B<max_time> == 0 (which means no timeout given). | |
27 | ||
28 | BIO_connect_retry() connects via the given B<bio>, retrying BIO_do_connect() | |
29 | until success or a timeout or error condition is reached. | |
30 | If the B<timeout> parameter is > 0 this indicates the maximum number of seconds | |
31 | to wait until the connection is established. A value of 0 enables waiting | |
32 | indefinitely, while a value < 0 immediately leads to a timeout condition. | |
33 | ||
34 | =head1 RETURN VALUES | |
35 | ||
36 | BIO_socket_wait(), BIO_wait(), and BIO_connect_retry() | |
37 | return -1 on error, 0 on timeout, and 1 on success. | |
38 | ||
39 | =head1 HISTORY | |
40 | ||
41 | BIO_socket_wait(), BIO_wait(), and BIO_connect_retry() | |
42 | were added in OpenSSL 3.0. | |
43 | ||
44 | =head1 COPYRIGHT | |
45 | ||
46 | Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. | |
47 | ||
48 | Licensed under the Apache License 2.0 (the "License"). You may not use | |
49 | this file except in compliance with the License. You can obtain a copy | |
50 | in the file LICENSE in the source distribution or at | |
51 | L<https://www.openssl.org/source/license.html>. | |
52 | ||
53 | =cut |