
Socket::msghdr provides advanced socket messaging operations via sendmsg and recvmsg. like their c counterparts, these functions accept few parameters, instead stuffing a lot of information into a complex structure.
this structure describes the message sent or received (buf), the peer on the other end of the socket (name), and ancillary or so-called control information (cmsghdr). this ancillary data may be used for file descriptor passing, ipv6 operations, and a host of implemenation-specific extensions.