TCP stick Package Processing-web stickers

Source: Internet
Author: User

Socket socket= NewSocket ();
Socket. settcpnodelay (True);

It should be able to solve the problem of sticking packets

 

Subcontracting may be difficult to solve...

 

 

For example
Adhesive package: X.5 packets
The half-pack is 0.5

For Network reasons, 0.5/1/2/2.5 /.... Packages
When receiving the package, you must first check the number of complete packages in the package. All the complete packages are processed, that is, all X is processed. The remaining 0.5 remain in the receiving area and wait for the next reception.
This time, we received 0.5 + 1.5/0.5 + 1.3/0.5 + 0. 5 .... We processed all the complete packages and threw away 0.8 of the incomplete packages.

Generally, after receiving the correct message, you must send a response to the sender. If the calculation does not time out, the sender resends the message.

You can't throw a head or tail.
No head or tail.
With a head or tail, but with something missing, you can throw it.
Something is missing and cannot be thrown

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.