Using standard linux sockets, is it possible for linux to return LESS than the size of the packet sent?
Assume we have entities A and B. If A sent B 3 messages, seconds apart so that the data could not possibly be combined into the same IP packets, and B performed a recv() on the socket for a size > the 3 messages AFTER the wait period, then all 3 messages would be delivered to the application layer concatenated. I've tested this and have consistently received this result.
Now, assume A sends B 1 message of 200 bytes. If the message is smaller than the MTU of the network, lets say the MTU is 1.5K, is there any scenario in which linux would NOT deliver the 200 bytes to the application in one call to recv()? Is there any possibility that linux could deliver the bytes as 150 followed by 50 on two separate socket read calls? - I understand that it is possible for IP packets to be delivered together, like in the previous scenario, but is it possible for an IP packet to not be delivered all at once to the application layer?
If so, does this prevent the need to frame packets messages if they are sufficiently small, say between 120-200 bytes?
And finally, is there any guarantee that a socket send(), of a relatively small size (200 bytes), sends in one TCP/IP packet?
Thanks for your help!