Erorr: Previous Request Not Completed

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Posts: 111
Joined: Thu Feb 08, 2007 11:27 am

Erorr: Previous Request Not Completed

Post by pkmittal » Mon Apr 20, 2015 10:56 am


My program wants to send HTTP request to PHP URL every 3 seconds (for multilayer game I am developing). To do this, I am using On Idle method which is sending http request every 3 seconds..

Now the program can send more HTTP Request in other handlers when when user has made some move.. ( Idle handler is already sending request in back ground). This start giving error message "Previous Request Not completed" quite often.. Does it mean that Live Code can not send http request when the previous request is not completed..

How can I resend the request automatically so that it works again.. Let say I have handler updateMove

Code: Select all

on updateMove
put postUserMove(username, movedpi, fromPlaceHolder,toPlaceHolder,serverPHTable) into returnText
   if returnText contains "Success" then
      Answer "Your move have been updated successfully."

  end if

end  updateMove
What should I change in function below so that when HTTP request through the error message "Previous request not compelted" then it sends the request automatically by calling the function again unless it is successful... I am trying the code below but it is getting recursive..and I need to know the right way of calling it..

Code: Select all

function postUserMove username, movedpi, fromPlaceHolder,toPlaceHolder,serverPHTable
   post postString to URL (urlString)
      put it into returnText 
    if returnText contains "previous request not completed" then
      postUserMove (username, movedpi, fromPlaceHolder,toPlaceHolder,serverPHTable)
      end if
   return returnText 
end postUserMove

Please help

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”