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