天道酬勤,学无止境

粘包

Solve the sticky package problem

table of Contents 1. Solve the problem of sticky package (low version) 1.1 Server 1.2 Client 1.3 Why is lowTwo, supplement the struct module 2.1 Simple to use Three, solve the sticky bag problem (Nick version) 3.1 Use the struct module to create a header 3.2 Server 3.3 ClientFour, TCP protocol sticky packet problem analysis 4.1 Server 4.2 Client 4.3 Server 4.4 Client1. Solve the problem of sticky package (low version)The root of the problem is that the receiving end does not know the length of the byte stream that the sender will transmit, so the way to solve the sticky packet is around, how

2021-04-19 19:59:56    分类:博客    粘包

Sticky bag problem

table of Contents 1. What is a sticky bag?Two, the four situations of TCP sending dataThree, two cases of sticky bag 3.1 Server 3.2 Client 3.3 Server 3.4 Client4. Supplementary question 1: Why TCP is reliable transmission and udp is unreliable transmission 5. Supplementary question 2: send (byte stream) and recv (1024) and sendall1. What is a sticky bag?Note: Only TCP has the phenomenon of sticking packets, UDP will never stick to packets, why, let me talk about it.First, you need to master the principle of a socket to send and receive messages The sending end can send data with one K and one

2021-04-19 19:59:43    分类:博客    粘包