Retransmission and duplicate data difference

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/oqqWang1234567/article/details/81871081

     Programming, especially in network programming, in order to solve business data, present during transmission loss problems, frequently used mechanism for retransmission.

     Some might say, TCP protocol has a timeout retransmission mechanism, it is not necessary to achieve again at the operational level. I think that if a business data, from A -> B -> C between, module A, B, C is a TCP connection, it is possible to connect B and C has been disconnected, the data is not sent success, that C does not receive traffic data a. Of course, we can log other means, why not find C are receiving A business data. But these are not within the scope of this article to discuss.

     Key is to say, and repeat business data retransmission difference. We may to cache business data by keyword, but the case of keywords, there may be a repeat of the situation. Repeat this, it needs to show that the same module retransmission of data caused? This keyword is already occupied by another module. Only clear up this distinction in order to correct the data processing business. such as:

    A -> B -> C and D -> B -> C, A to C transmits ID of 1, if no response is received, a retransmission preparation A; D simultaneously also transmits the ID to the preparation of a C data for case C, it is clear that to be able for the data ID 1, and a is a retransmission or a new transmission of D.

    As for how to solve the problem, leaving behind the discussion, here is a record of his own ideas.

Guess you like

Origin blog.csdn.net/oqqWang1234567/article/details/81871081