NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: minimum write size of SOCK_STREAM?



On Fri, 31 Oct 2025, Andrew Cagney wrote:

With SOCK_STREAM, partial reads can always happen. If you want whole-packet
reads (< MTU size) you'll have to use SOCK_DGRAM or SOCK_SEQPACKET; or send
the message size too, so that the server can loop until it gets the whole
packet.

yea, might be time to update to SOCK_SEQPACKET


If you want to keep using SOCK_STREAM, then see: sendmsg(2), CMSG_DATA(3) and
recvmsg(2) (w/ MSG_WAITALL).

-RVP


Home | Main Index | Thread Index | Old Index