Socket programming, what is FD and SD
I am programming an SSL socket and many times I have seen something (variable name, function ...) with FD or SD in its name. For example, OpenSSL provides a function:
int fd = SSL_get_fd(...);
In many tutorials ( here , here, and here ), this is used:
int sd = socket(...);
Can anyone please explain what FD and SD mean?
thank
source to share
SSL_get_fd () returns a handle to the file
On Unix operating systems and related computers, a file descriptor (FD, less commonly fildes) is an abstract indicator used to access a file or other I / O resource, such as a pipe or network connection. File descriptors are part of the POSIX API. A file descriptor is a non-negative integer, represented in the C programming language as an int.
wfd
, rfd
would mean write-FD and read-FD. sd
is not a standard nickname, but most likely it will stand for a socket file descriptor, i.e. FD that matches the socket. On the same page SSL_get_fd
:
fd will usually be the file descriptor for the network connection socket
source to share