Import OpenSSL-0.9.8i.
[dragonfly.git] / crypto / openssl-0.9.7d / doc / ssl / SSL_set_fd.pod
blob70291128fcec08ed036b85e009a398ceb66d9f3f
1 =pod
3 =head1 NAME
5 SSL_set_fd - connect the SSL object with a file descriptor
7 =head1 SYNOPSIS
9  #include <openssl/ssl.h>
11  int SSL_set_fd(SSL *ssl, int fd);
12  int SSL_set_rfd(SSL *ssl, int fd);
13  int SSL_set_wfd(SSL *ssl, int fd);
15 =head1 DESCRIPTION
17 SSL_set_fd() sets the file descriptor B<fd> as the input/output facility
18 for the TLS/SSL (encrypted) side of B<ssl>. B<fd> will typically be the
19 socket file descriptor of a network connection.
21 When performing the operation, a B<socket BIO> is automatically created to
22 interface between the B<ssl> and B<fd>. The BIO and hence the SSL engine
23 inherit the behaviour of B<fd>. If B<fd> is non-blocking, the B<ssl> will
24 also have non-blocking behaviour.
26 If there was already a BIO connected to B<ssl>, BIO_free() will be called
27 (for both the reading and writing side, if different).
29 SSL_set_rfd() and SSL_set_wfd() perform the respective action, but only
30 for the read channel or the write channel, which can be set independently.
32 =head1 RETURN VALUES
34 The following return values can occur:
36 =over 4
38 =item 0
40 The operation failed. Check the error stack to find out why.
42 =item 1
44 The operation succeeded.
46 =back
48 =head1 SEE ALSO
50 L<SSL_get_fd(3)|SSL_get_fd(3)>, L<SSL_set_bio(3)|SSL_set_bio(3)>,
51 L<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>,
52 L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)>
54 =cut