1BIO_s_socket(3)                     OpenSSL                    BIO_s_socket(3)
2
3
4

NAME

6       BIO_s_socket, BIO_new_socket - socket BIO
7

SYNOPSIS

9        #include <openssl/bio.h>
10
11        BIO_METHOD *BIO_s_socket(void);
12
13        long BIO_set_fd(BIO *b, int fd, long close_flag);
14        long BIO_get_fd(BIO *b, int *c);
15
16        BIO *BIO_new_socket(int sock, int close_flag);
17

DESCRIPTION

19       BIO_s_socket() returns the socket BIO method. This is a wrapper round
20       the platform's socket routines.
21
22       BIO_read() and BIO_write() read or write the underlying socket.
23       BIO_puts() is supported but BIO_gets() is not.
24
25       If the close flag is set then the socket is shut down and closed when
26       the BIO is freed.
27
28       BIO_set_fd() sets the socket of BIO b to fd and the close flag to
29       close_flag.
30
31       BIO_get_fd() places the socket in c if it is not NULL, it also returns
32       the socket. If c is not NULL it should be of type (int *).
33
34       BIO_new_socket() returns a socket BIO using sock and close_flag.
35

NOTES

37       Socket BIOs also support any relevant functionality of file descriptor
38       BIOs.
39
40       The reason for having separate file descriptor and socket BIOs is that
41       on some platforms sockets are not file descriptors and use distinct I/O
42       routines, Windows is one such platform. Any code mixing the two will
43       not work on all platforms.
44
45       BIO_set_fd() and BIO_get_fd() are macros.
46

RETURN VALUES

48       BIO_s_socket() returns the socket BIO method.
49
50       BIO_set_fd() always returns 1.
51
52       BIO_get_fd() returns the socket or -1 if the BIO has not been
53       initialized.
54
55       BIO_new_socket() returns the newly allocated BIO or NULL is an error
56       occurred.
57

SEE ALSO

59       TBA
60
61
62
631.0.2o                            2019-09-10                   BIO_s_socket(3)
Impressum