I have a tool which takes any time from a minute to couple of hours. I want to write a web application to enable users to run the tool from webpage. Since each tool run takes longer time, i want to send the tool run request from the webpage, then i want to update the page with status information. For updating the status information, the client has to poll the server. Is there any way by which server can send the status message to the client without a request
You can use web-sockets which are two way communication between client and server that remain open and allow the server to send without request from the client.
HTTP Basics As a quick summary, the HTTP/1.1 protocol works as follows: The client (usually a browser) opens a connection to the server and sends a request. The server processes the request, generates a response, and closes the connection if it finds a Connection: Close header.
Servers only wait for requests from clients. Unless they also act as a client to other servers.
Push technology or server push is a style of Internet-based communication where the request for a given transaction is initiated by the publisher or central server. It is contrasted with pull/get, where the request for the transmission of information is initiated by the receiver or client.
You can use web-sockets which are two way communication between client and server that remain open and allow the server to send without request from the client. However web-sockets are new and browser support is only for the most current browsers.
socket.io is a great library for web sockets with fall backs to AJAX and flash if they are not supported.
Other than that the only other way for the server to send data to the clients is after the client has sent a request. There is methods using AJAX polling from the client to check for updates from the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With