Help, socket TCP receives a large number of packets per second, how not to drop packets, please see the content for details
For large packets it is recommended that they are still transmitted in segments, that is, you have to write your own protocol on sending and receiving a one-time read or send is not a good practice, although the TCP in the process of sending the data will be verified and so on, but if the buffer is full all of a sudden the beginning of the loss of some of the data it is recommended that segments of the send and receive segments both by the client to determine the frequency of sending (assuming that a 1 M packet segmentation called 8K a small packet then becomes sent 128 times in the client receives one of the packet is assumed to be the first N in the reception of the end and verify that the data is correct, then the client sends the server a request for a packet so that the server sends the first N +1 packet to deal with it in turn)