I am trying to implement polling ( I know this is not advised, I have no choice) using asynchronous http. I am using synchronous http now, but I feel it is best to change to asynchronous.
This is what my code looks like now using asynch:
[lua]function response(event)
if event.isError then
print(“network error”)
else
print("RESPONSE: "…event.response)
end
end
function chatPoll(event)
network.request( “http://url/?","POST”,response,{ body = “body” } )
end
chatTimer=timer.performWithDelay(10000, chatPoll,0 )–for updating msg board[/lua]
Problem is, it never executes the function response(). I seem to have had this problem before – a listener calling another listener – and found a way around it, but this time I am not sure how to do this another way.
can a listener not call another listener? Is there another way to do this?
-Amanda [import]uid: 29997 topic_id: 14105 reply_id: 314105[/import]