Problem. I send on the server function. It can be anything (for example, a function with an infinite loop came to the server, it is clear that everything will become. The question is how to avoid it? Ie, for example, set a timeout for which the server will forcefully respond to the request and terminate the cycle.