Send multiple datagrams with a single send () call?

When using a datagram-based socket (raw socket or UDP) with style-style sending, all data is combined to form a single IP packet. Is there a way to send multiple datagrams with a single call?

+3
source share
3 answers

The call you are looking for, sendmmsg()however, has not yet been implemented or is not even being discussed. You can see that it gets a side double recvmmsg()in the latest Linux 2.6.3 kernel.

+2
source

I don’t think so ... How would you expect the IP stack to determine where you intend to use the packet datagram?

0
source

, , , send-style send(), , , .

So, you have several pieces of data that you want to send several datagrams to. Why don't you send them with separate calls to send?

In fact, you can call connect () on the datagram socket to specify the default target so that you can send () or write () without specifying the destination address each time.

0
source

Source: https://habr.com/ru/post/1704509/


All Articles