-2

As shown in the following pictures.

When my client sends a binary JSON file to the server, the server keeps blocking and receiving an empty binary file.I personally think that it may be a problem with the parameters in the "rev" function, but I cannot think of a good solution.

[This is main document](https://i.stack.imgur.com/9nczj.png)
[This is client](https://i.stack.imgur.com/OCko5.png)
[This is server socket](https://i.stack.imgur.com/5embJ.png)
[This is result](https://i.stack.imgur.com/js05h.png)

Replacing part of the code with the code shown in the following pictures can solve the problem, but it is obviously not wise This is my attempt

  • Please **provide code as properly formatted text** inside the question, instead of providing it only as a linked image. Also reduce the code to the essential parts and explain what you expect it to do and why. See [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) for what is expected for a good question - which you should provide if you want a good answer. – Steffen Ullrich Aug 26 '23 at 06:01
  • https://idownvotedbecau.se/imageofcode, https://idownvotedbecau.se/toomuchcode/ – Steffen Ullrich Aug 26 '23 at 06:08
  • thank you , but i got answer.Other people who want to know can look here.https://stackoverflow.com/questions/37330993/sock-recv-returns-empty-string-when-connection-is-dead-on-non-blocking-socke – PancakeCivet Aug 26 '23 at 07:22
  • Welcome to Stack Overflow. Please read [ask] and [How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/questions/261592) - in the future, please search for the duplicate *before* posting. If you cannot find a satisfactory existing question, make sure to post *simple* code that someone else can *copy and paste, without adding or changing anything, to see the exact problem, directly*. Please also see the [formatting help](https://stackoverflow.com/help/formatting) in order to understand how to post code properly. – Karl Knechtel Aug 26 '23 at 09:32

0 Answers0