include/openssl: don't include <windows.h> in public headers.
[openssl.git] / doc / ssl / SSL_get_all_async_fds.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_waiting_for_async, SSL_get_all_async_fds, SSL_get_changed_async_fds - manage
6 asynchronous operations
7
8 =head1 SYNOPSIS
9
10  #include <openssl/async.h>
11  #include <openssl/ssl.h>
12
13  int SSL_waiting_for_async(SSL *s);
14  int SSL_get_all_async_fds(SSL *s, OSSL_ASYNC_FD *fd, size_t *numfds);
15  int SSL_get_changed_async_fds(SSL *s, OSSL_ASYNC_FD *addfd, size_t *numaddfds,
16                                OSSL_ASYNC_FD *delfd, size_t *numdelfds);
17
18 =head1 DESCRIPTION
19
20 SSL_waiting_for_async() determines whether an SSL connection is currently
21 waiting for asynchronous operations to complete (see the SSL_MODE_ASYNC mode in
22 L<SSL_CTX_set_mode(3)>).
23
24 SSL_get_all_async_fds() returns a list of file descriptor which can be used in a
25 call to select() or poll() to determine whether the current asynchronous
26 operation has completed or not. A completed operation will result in data
27 appearing as "read ready" on the file descriptor (no actual data should be read
28 from the file descriptor). This function should only be called if the SSL object
29 is currently waiting for asynchronous work to complete (i.e.
30 SSL_ERROR_WANT_ASYNC has been received - see L<SSL_get_error(3)>). Typically the
31 list will only contain one file descriptor. However if multiple asynchronous
32 capable engines are in use then more than one is possible. The number of file
33 descriptors returned is stored in B<*numfds> and the file descriptors themselves
34 are in B<*fds>. The B<fds> parameter may be NULL in which case no file
35 descriptors are returned but B<*numfds> is still populated. It is the callers
36 responsibility to ensure sufficient memory is allocated at B<*fds> so typically
37 this function is called twice (once with a NULL B<fds> parameter and once
38 without).
39
40 SSL_get_changed_async_fds() returns a list of the asynchronous file descriptors
41 that have been added and a list that have been deleted since the last
42 SSL_ERROR_WANT_ASYNC was received (or since the SSL object was created if no
43 SSL_ERROR_WANT_ASYNC has been received). Similar to SSL_get_all_async_fds() it
44 is the callers responsibility to ensure that B<*addfd> and B<*delfd> have
45 sufficient memory allocated, although they may be NULL. The number of added fds
46 and the number of deleted fds are stored in B<*numaddfds> and B<*numdelfds>
47 respectively.
48
49 =head1 RETURN VALUES
50
51 SSL_waiting_for_async() will return 1 if the current SSL operation is waiting
52 for an async operation to complete and 0 otherwise.
53
54 SSL_get_all_async_fds() and SSL_get_changed_async_fds() return 1 on success or
55 0 on error.
56
57 =head1 NOTES
58
59 On Windows platforms the openssl/async.h header is dependent on some
60 of the types customarily made available by including windows.h. The
61 application developer is likely to require control over when the latter
62 is included, commonly as one of the first included headers. Therefore
63 it is defined as an application developer's responsibility to include
64 windows.h prior to async.h.
65
66 =head1 SEE ALSO
67
68 L<SSL_get_error(3)>, L<SSL_CTX_set_mode(3)>
69
70 =head1 HISTORY
71
72 SSL_waiting_for_async(), SSL_get_all_async_fds() and SSL_get_changed_async_fds()
73 were first added to OpenSSL 1.1.0.
74
75 =head1 COPYRIGHT
76
77 Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
78
79 Licensed under the OpenSSL license (the "License").  You may not use
80 this file except in compliance with the License.  You can obtain a copy
81 in the file LICENSE in the source distribution or at
82 L<https://www.openssl.org/source/license.html>.
83
84 =cut