]>
Commit | Line | Data |
---|---|---|
6dcbaf58 DSH |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
8eec1389 | 5 | BIO_s_socket, BIO_new_socket - socket BIO |
6dcbaf58 DSH |
6 | |
7 | =head1 SYNOPSIS | |
8 | ||
9 | #include <openssl/bio.h> | |
10 | ||
04f6b0fd | 11 | const BIO_METHOD *BIO_s_socket(void); |
6dcbaf58 | 12 | |
6dcbaf58 DSH |
13 | BIO *BIO_new_socket(int sock, int close_flag); |
14 | ||
15 | =head1 DESCRIPTION | |
16 | ||
bace2124 | 17 | BIO_s_socket() returns the socket BIO method. This is a wrapper |
6dcbaf58 DSH |
18 | round the platform's socket routines. |
19 | ||
b055fceb | 20 | BIO_read_ex() and BIO_write_ex() read or write the underlying socket. |
6dcbaf58 DSH |
21 | BIO_puts() is supported but BIO_gets() is not. |
22 | ||
23 | If the close flag is set then the socket is shut down and closed | |
24 | when the BIO is freed. | |
25 | ||
6dcbaf58 DSH |
26 | BIO_new_socket() returns a socket BIO using B<sock> and B<close_flag>. |
27 | ||
28 | =head1 NOTES | |
29 | ||
30 | Socket BIOs also support any relevant functionality of file descriptor | |
31 | BIOs. | |
32 | ||
33 | The reason for having separate file descriptor and socket BIOs is that on some | |
34 | platforms sockets are not file descriptors and use distinct I/O routines, | |
35 | Windows is one such platform. Any code mixing the two will not work on | |
36 | all platforms. | |
37 | ||
38 | =head1 RETURN VALUES | |
39 | ||
40 | BIO_s_socket() returns the socket BIO method. | |
41 | ||
6dcbaf58 DSH |
42 | BIO_new_socket() returns the newly allocated BIO or NULL is an error |
43 | occurred. | |
44 | ||
e2f92610 RS |
45 | =head1 COPYRIGHT |
46 | ||
47 | Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. | |
48 | ||
4746f25a | 49 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
50 | this file except in compliance with the License. You can obtain a copy |
51 | in the file LICENSE in the source distribution or at | |
52 | L<https://www.openssl.org/source/license.html>. | |
53 | ||
54 | =cut |