nix::sys::socket

Function sendmmsg

source
pub fn sendmmsg<'a, XS, AS, C, I, S>(
    fd: RawFd,
    data: &'a mut MultiHeaders<S>,
    slices: XS,
    addrs: AS,
    cmsgs: C,
    flags: MsgFlags,
) -> Result<MultiResults<'a, S>>
where XS: IntoIterator<Item = &'a I>, AS: AsRef<[Option<S>]>, I: AsRef<[IoSlice<'a>]> + 'a, C: AsRef<[ControlMessage<'a>]> + 'a, S: SockaddrLike + 'a,
Expand description

An extension of sendmsg that allows the caller to transmit multiple messages on a socket using a single system call. This has performance benefits for some applications.

Allocations are performed for cmsgs and to build msghdr buffer

§Arguments

  • fd: Socket file descriptor
  • data: Struct that implements IntoIterator with SendMmsgData items
  • flags: Optional flags passed directly to the operating system.

§Returns

Vec with numbers of sent bytes on each sent message.

§References

sendmsg