This article is a mirror article of machine translation, please click here to jump to the original article.

View: 23923|Reply: 0

[Source] Regarding socket communication, many \0\0\0\0 solutions are accepted

[Copy link]
Posted on 6/3/2016 12:01:53 PM | | | |
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
Before our characters are processed, the accepted characters are followed by a large string of \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 However, if you look at it with text, it will not be displayed.

Why do there so many \0\0\0\0\0\0\0\0???? How to solve it?

Some people say: str = str. Replace("\0","");  It is obviously wrong to solve it like this, although it can be solved, so inefficient is too low!

The return value of Receive is the number of bytes actually received.


I found this sentence:

Solution:



As shown below!







Previous:C# uses the linq syntax to set up a set of data for every N entries
Next:c# Dictionary The given key was not present in the dictionary
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com