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