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