A message stick package
1、TCP
And data plane packet of sticky nature does not occur on TCP
TCP sender and receiver will ensure that the data is an orderly way to reach clients
And will ensure a complete packet
TCP data transmission comprising: sequential, integrity
2、UDP
UDP does not guarantee message integrity, so often UDP packet loss, etc.
In the conventional call Socket "stick pack", not sticky packet data transmission level
3, stick package
"Stick pack" stick package is happening on the logical level of data processing
Here the word "stick pack": Includes TCP, UDP or even any other data streams interactive program
Mina, Netty and other fundamental framework is also to solve the stick package designed for high concurrency library
Second, the message is not complete
From the level in terms of TCP data transmission failure and other data loss does not occur
When the event is a must stop running TCP termination
"Incomplete data" is still aimed at receiving logic-level data
In the physical transmission level in terms of data security must be able to complete delivery to the other end
However, the other end of the buffer may be insufficient or incomplete data processing result in the data portion of the data can only be read
This condition is called "incomplete data", "data loss", etc.
Third, how orderly transfer data mixed
Adding a start end tag data transmission (such as line feed character, line by line read)
Data transmission scheme using fixed head
Hybrid scheme: fixed head, data encryption, data description
Fourth, icon
4.1 sticky packets of data
4.2 Incomplete data
4.3 Information Error
4.4 Adding header
Fives,
1, data transmission and reception process
2、
3, construction of ordered message
Six, header adding functionality UML Class Diagram