Long- polling
II. The request web page executes Java script which requests a file from the server.
III. The server donate quickly respond with the requested information but waits until there’s new information available.
IV. When new information available the server respond with the new information.
V. The client receives the information and sends another request to the server, re-starting the process.
Server sent Events
Like the long polling
- Client sent request
- Webpage execute it
- The server send an event to the client when new information available.
- Real time traffic from server to client that we shall need.
- We’ll want to use a server that has an event loop.
- Not possible to connect with a server from another domain
Web Sockets
Like previousA client requested to webpage
The request webpage execute Java script
The server and client now send message each other when new data is available.
· Real- time traffic from the server to the client and from the client to the server.
· We will want to use a server that has an event lap.
· With web sockets it is possible to connect with a server from another domain.
· It is also possible to use a third party hosted web socket server for example pusher or others.
· This way we will only have to implement the client side which is very easy.
0 comments:
Post a Comment