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