Receiving message written by writev() in multiple chunks

Alexander Senier alex at ...331...
Wed Aug 16 13:03:14 CEST 2017


Hi Christian,

I agree that applications should be able to cope with that situation and that theres no guarantee about fragmentation in recv(). I will fix the
respective test case and hope no real applications do rely on that behavior. I'm OK with leaving the implementation as is.

Thanks!

Cheers,
Alex

On 15.08.2017 11:26, Christian Helmuth wrote:
> Hi Alexander,
> 
> I share your feeling that it may be better to adopt the behavior of
> Linux and Android to stay on safe grounds. But on the other hand, I
> could not find any reference which states that recv() will return a
> complete TCP segment in all cases (only the opposite, e.g., [1]).
> Please correct me if I'm wrong. Therefore, any application relying on
> this fact would be broken. Regarding writev() to the local socket
> buffer most implementations also seems to gather all data from the
> iovec in one run. But, this is hidden from the receiver, which has to
> expect that the data was fragmented on any network layer including the
> syscall interface.
> 
> For these reasons, I suggest we leave the implementation as is for now.
> 
> [1] https://stackoverflow.com/questions/3198049/what-value-will-recv-return-if-it-receives-a-valid-tcp-packet-with-payload-siz
> 
> Greets
> 




More information about the users mailing list