Reputation: 91
by TCP socket programming: on my application, receiver side uses a small size buffer then transmitted data. So recv() is called several times til all data is received. On each call of recv(), used buffer is copied to another big buffer or appending to a file partly.
My question here is, should I handle the received TCP "packet order" in my code additionally, or TCP handles it on its own buffer on the background? Because transmitted TCP packets arrive to the receiver side not in a correct order.
Upvotes: 0
Views: 350
Reputation: 3541
My question here is, should I handle the received TCP "packet order" in my code additionally
No. TCP guarantees that it will handover the data to the application in the order it is received. Application need not implement the logic to ensure the order of data reception. Review your application code again for any bugs which is resulting in the received data being not in the same order it was sent.
Upvotes: 1