There are a few reasons for this. First, the while loop is very simple and does not need to be encapsulated in a function. It only does two things: get the current time and send it to the server.

Second, making the while loop into its own function would make the code less readable. The main function would then need to call the while loop function repeatedly, which would make the code more complex.

Finally, making the while loop into its own function would not provide any real benefits. The code would still be doing the same thing, it would just be organized differently.

However, there are some cases where it might make sense to make a while loop into its own function. For example, if the while loop is doing a complex task, or if it needs to be reused in multiple places in the code.

In the case of the TCP client code, the while loop is simple and does not need to be reused, so it makes sense to keep it as part of the main function.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence