Hacker News new | ask | show | jobs
by im2w1l 3788 days ago
I looked it up, and it seems that while IP will reassemble packets, there is no 1-1 mapping between send calls and IP packets, when using TCP.

You are only guaranteed to get the bytes in the correct order but you have to find the boundaries between messages yourself.

1 comments

That's correct. A send call could call with a 1GB buffer and the IP layer would have to break it up into multiple datagram packets. That's the nature of TCP. Again sending large message is expanding the requirement beyond what is capable in UDP, while we were striking to emulate UDP in sending short unreliable message.