N
N
newaitix2015-02-08 13:34:18
PHP
newaitix, 2015-02-08 13:34:18

What are the ways to give data to the user?

Actually, the question is not new and there are implementations, a lot of services are already working. But I still don't understand how it all works. I know that in general it is called Comet and that's it.
Heard about
WebSocked
long poll
infinite iframe
But I do not understand the essence.
The questions I can't get answers to are:
What is needed to implement comet and in what cases? It is clear that nothing is needed to periodically poll the server, you can simply request data using setInterval and the server will go down. What is needed exactly in order to suspend the request and respond to it later? Which implementations load the server the least? Do I need a specific server, do I need specific settings for the server itself? What and how should be done step by step in order to implement continuous data exchange between the client and the server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-02-08
@begemot_sun

Hello. Your PHP is designed to process the request and die. In a proper client/server world, no one dies, everyone stays connected and remembers their state. That. you need to use anything a normal Socket can do. Further, anything can go on top of it (for example, WebSocket).
You can do it with PHP too, but it's not recommended.
Candidates: C++, Erlang, Lisp, Haskell, Python, etc.

V
Vadim, 2015-02-09
@wanhelsing

What is needed to implement comet

web sockets.
in the case of older browsers, sock.js will help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question