]> git.ipfire.org Git - thirdparty/openssl.git/blame_incremental - doc/man3/BIO_socket_wait.pod
Don't exclude quite so much in a no-sock build
[thirdparty/openssl.git] / doc / man3 / BIO_socket_wait.pod
... / ...
CommitLineData
1=pod
2
3=head1 NAME
4
5BIO_socket_wait,
6BIO_wait,
7BIO_connect_retry
8- BIO socket utility functions
9
10=head1 SYNOPSIS
11
12 #include <openssl/bio.h>
13
14 #ifndef OPENSSL_NO_SOCK
15 int BIO_socket_wait(int fd, int for_read, time_t max_time);
16 #endif
17 int BIO_wait(BIO *bio, time_t max_time, unsigned int milliseconds);
18 int BIO_connect_retry(BIO *bio, long timeout);
19
20=head1 DESCRIPTION
21
22BIO_socket_wait() waits on the socket B<fd> for reading if B<for_read> is not 0,
23else for writing, at most until B<max_time>.
24It succeeds immediately if B<max_time> == 0 (which means no timeout given).
25
26BIO_wait() waits at most until B<max_time> on the given B<bio>,
27which is typically socket-based,
28for reading if B<bio> is supposed to read, else for writing.
29It succeeds immediately if B<max_time> == 0 (which means no timeout given).
30If sockets are not available it succeeds after waiting at most given
31B<milliseconds> in order to help avoiding a tight busy loop at the caller.
32
33BIO_connect_retry() connects via the given B<bio>, retrying BIO_do_connect()
34until success or a timeout or error condition is reached.
35If the B<timeout> parameter is > 0 this indicates the maximum number of seconds
36to wait until the connection is established. A value of 0 enables waiting
37indefinitely, while a value < 0 immediately leads to a timeout condition.
38
39=head1 RETURN VALUES
40
41BIO_socket_wait(), BIO_wait(), and BIO_connect_retry()
42return -1 on error, 0 on timeout, and 1 on success.
43
44=head1 HISTORY
45
46BIO_socket_wait(), BIO_wait(), and BIO_connect_retry()
47were added in OpenSSL 3.0.
48
49=head1 COPYRIGHT
50
51Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
52
53Licensed under the Apache License 2.0 (the "License"). You may not use
54this file except in compliance with the License. You can obtain a copy
55in the file LICENSE in the source distribution or at
56L<https://www.openssl.org/source/license.html>.
57
58=cut