I can make requests to the server GET/POST . But if I need to constantly receive data, then how to be? Really, the same requests, but in an infinite loop? How to do it?
- oneRead socket connections. TCP / UDP - markov
- Thanks now at least I know where to dig - Flippy
- And what do you mean by "Server". If the web server is the only way I’m afraid, you can try not to close the connection after GET by setting the Keep-Alive header, but you will still have to send requests. But if the “Server” is something more than just the HTTP protocol, then yes, UDP / TCP or your Websocket server can support the protocol - Mike
- oneLong polling will probably suit you - the connection opens, but it does not close for a long time and you can transfer data through it. The truth will have to handle the connection differently. - Mikhail Vaysman
|
1 answer
Nowadays, if they say "server", they mean a "web server." WebSocket protocol is implemented for web servers for continuous data retrieval. I wrote a client on Android using Java-WebSocket , it works.
|