I build UDP server or TCP server which use recv() or recvfrom for receiving packets from clients
but it seems to me that the mechanism is: the kernel receive packets from network
and stripe the IP/TCP/UDP header and then put the data payload part in the
kernel buffer, then recv() or recvfrom() read the data in from the kernel buffer
so this means there are only bytes in the buffer, and the bytes are not divided into parts, each of which corresponds to the payload of a UDP datagram/TCP segment
if I hope each call of recv() or recvfrom() only receives one TCP segment or UDP datagram(note, one TCP or UDP packet may includes several IP packets due to IP fragmentation)
is it possible or not?
if so, how? thanks!