Good day.
I use the net library to communicate with the server. The client is written in C ++ and uses normal system sockets. I transfer to the client a set of data, in the form of portions. I noticed that the server does not wait until the client receives the data and immediately sends the next packet. Because of this, the client does not process the intended portion, but rather joins some portions together. Before me was the question: How to ensure that the server waited for the moment - when the packet reaches the client, and only then send the next packet. I read a little about the specifics of sockets, I learned that sockets can be blocked and not blocked. I mean, at the native level, there is something like the TCP_NO_WAIT flag, which says that you do not need to wait for a response about the delivery of data, which is why, without waiting for it, it immediately sends the next batch.
So, how to make a socket blocked? So that he waited for a response on the delivery and only then sent the next packet.