ProcessEvents not firing Net::Process
by Jeremiah Fulbright · in Torque Game Engine Advanced · 04/15/2009 (5:56 pm) · 3 replies
I am finally moving our codebase to 1.8.1 and noticed that one our modules which queries a webpage for some information is no longer working.
Its a simple post to a webpage which in return gives us some data back which we parse in our class, it worked fine in 1.7.
I've set up a "Blocking" implementation which isn't optimal, but wasn't sure on best way to make sure the engine didn't do anything else till we got at least something back, whether a disconnect or dns failed etc. It currently freezes up the engine in the blocking call (while loop), because the TCPObject seems to not be processing packets even when we're calling Process:processEvents();
If I remove the "block" and just let things continue to load, it does communicate and return the data, but I need for it to be handled before anything else loads.
Is there a bug with a trigger somewhere or maybe some recommendations on a better way to handle the "blocking"
Its a simple post to a webpage which in return gives us some data back which we parse in our class, it worked fine in 1.7.
I've set up a "Blocking" implementation which isn't optimal, but wasn't sure on best way to make sure the engine didn't do anything else till we got at least something back, whether a disconnect or dns failed etc. It currently freezes up the engine in the blocking call (while loop), because the TCPObject seems to not be processing packets even when we're calling Process:processEvents();
If I remove the "block" and just let things continue to load, it does communicate and return the data, but I need for it to be handled before anything else loads.
Is there a bug with a trigger somewhere or maybe some recommendations on a better way to handle the "blocking"
#2
Maybe you somehow ended up blocking the DNS lookup, which shouldn't happen because it's done by another thread.
Try placing some breakpoints around NetAsync to see what's going on.
04/16/2009 (12:56 pm)
Looking at the code, Process::processEvents() should call Net::process(), unless your code takes place before Net::init(), which is very unlikely.Maybe you somehow ended up blocking the DNS lookup, which shouldn't happen because it's done by another thread.
Try placing some breakpoints around NetAsync to see what's going on.
#3
I did do some breakpoints and Net::Process does get called, but theres never valid data so it doesn't go thru anything else in the function. I'm working from scratch now though to make sure something didn't get messed up during the merge.
As I know it works fine in 1.7.1 and even works fine, if I don't do any kind of blocking, which would seem to mean something else is happening with how its processing the data
04/16/2009 (1:21 pm)
Yeah, it seems it never even makes a connection or attempt to connect, otherwise, it'd be "timing out" at some point and at least giving an error state.I did do some breakpoints and Net::Process does get called, but theres never valid data so it doesn't go thru anything else in the function. I'm working from scratch now though to make sure something didn't get messed up during the merge.
As I know it works fine in 1.7.1 and even works fine, if I don't do any kind of blocking, which would seem to mean something else is happening with how its processing the data
Torque Owner Jeremiah Fulbright
I set mBlocking to true in the initial call, but in any of the failure or success situations, mBlocking is set to false, so even if it the connection was fully failing, it'd still continue on with everything
// we won't go further until mBlocking is cleared mBlocking = true; post("http://xxxx.com", "/index.php", "guid", guid); // We really shouldn't process events still, as it could mess up timing // but it seems to work okay for what we're doing while(mBlocking) { Process::processEvents(); Platform::sleep(1); }