Contains socket address information.
#include <sys/socket.h>
struct sockaddr
{
sa_family_t sa_family;
char sa_data[14];
};
Specifies the address family.
Specifies the direct address (maximum of 14 bytes).
The sockaddr structure is used for TCP over IP sockets. The length of the socket structure is fixed at 16 bytes.
Typically, a client program uses zeros for both fields. This ensures that the client program is unique for each session of the network application running with the same server. Normally, a server specifies only the port.
For IPv4, use the sockaddr_in structure to specify the address by combining the fields: sin_port+sin_addr+sin_zero.
For IPv6, use the sockaddr_in6 structure to specify the address.