I am creating a simple socket web server using sys / socket.h lib and I stumbled upon socklen_tand sa_family_tand I am a bit confused about what their actual purpose is.
Definition:
sa_family_t - unsigned type of integral.socklen_t - An unsigned opaque integral type of at least 32 bits in length.
Now I understand that the <sys/socket>lib declares three structures ( sockaddr, msghdr, cmsghdr), which contain members of announcing these data types.
sa_family_t sa_family address familysocklen_t msg_namelen size of addresssocklen_t msg_controllen ancillary data buffer lensocklen_t cmsg_len data byte count, including the cmsghdr
But why create new data types, why not just use a data type unsigned int?
source
share