Here the scenario I'm imagining. Two messages are transferred, both will require 2 packets each (I know you don't deal with packets directly with TCP, but on the IP level each message will consist of 2 packets [or segments as they're called in TCP])
The problem I'm imaging is buffering the first packet of the first message, but a router dumps the second packet for some reason. Being TCP, the second packet is guaranteed to be resent, and I know that TCP will hand these two packets up to the application layer in order. But while being handled asynchronously, this first packet will still be handed up to the application which will not block during the period in which the underlying TCP layer handles the retransmission of the second packet. What will happen if the first packet of the second transmission arrives before the last packet of the first transmission? Will TCP not hand these packets up until the first transmission is handled in full? Will an async client not send the second message before the first has been handled in full?
I know that TCP will guarantee the order of packets for each message. My confusion is whether it will fully complete one transmission before processing the second transmission when being handled asynchronously.