Your comments

i use http

and the problem lies in the fact that there is no possibility of control

no possibility of interrupting the connection.
and the program hangs in an attempt to connect to the server - (push, pull ...)