BIO_s_socket.pod 1.4 KB

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