The UnixDatagram type provides send and send_to methods, but does not provide a vectored send operation. Such an operation is particularly helpful for datagrams, where separate send operations result in separate datagrams; a vectored send allows sending data from multiple buffers in a single datagram.
Given that UnixDatagram only runs on UNIX, where writev works just fine on a socket, such an operation could use writev; alternatively, this could use sendmsg, which supports supplying an iovec. sendmsg would also allow a vectored send_to operation.
The
UnixDatagramtype providessendandsend_tomethods, but does not provide a vectored send operation. Such an operation is particularly helpful for datagrams, where separate send operations result in separate datagrams; a vectored send allows sending data from multiple buffers in a single datagram.Given that
UnixDatagramonly runs on UNIX, wherewritevworks just fine on a socket, such an operation could usewritev; alternatively, this could usesendmsg, which supports supplying an iovec.sendmsgwould also allow a vectoredsend_tooperation.