Saturday 15 October 2016

javascript - How to terminate a php server script while it is waiting for a reply from a php client script?

Currently I have a setInterval javascript function which calls an ajax function to call a php script. This php script is a server that is waiting for a request from a client being run by another program. The client will send a String whenever there are changes made and this string is to be echoed back through ajax.



setInterval(function(){getTopo()}, 2000);


getTopo() is a $.ajax calling server.php



I want to terminate the server.php file if there is no reply within 2 secs before running getTopo() again.




Else can I output through ajax an echo in the php's while loop?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...