My app is suspending and it's killing me

BlitzMax Forums/BlitzMax Programming/My app is suspending and it's killing me

Ked(Posted 2009) [#1]
I have a small little (and windowed) demo I'm working on with GNet. When two people are connected and "playing" if someone moves the window (eh... keeps the mouse held down on the titlebar for 5+ seconds) the player gets disconnected. Does anyone know how I can fix/work around this?


jsp(Posted 2009) [#2]
Do you rely on the WaitEvent() queue? Because nothing is updated then until you release the mouse. You could use a hook function instead.


ImaginaryHuman(Posted 2009) [#3]
Add a thread that runs in the background to make sure the connection stays alive?


Ked(Posted 2009) [#4]
Do you rely on the WaitEvent() queue? Because nothing is updated then until you release the mouse. You could use a hook function instead.

I use PolledInput. Eh... moving everything into a hook is messy and I'm not sure it would be very safe (accessing Globals, running functions, etc) from inside a hook.

Add a thread that runs in the background to make sure the connection stays alive?

I want to keep things single-threaded.


Mark Tiffany(Posted 2009) [#5]
As above, you will need an eventhook, but you might be able to have it just send a simple "ping" to ensure that other servers know you are still alive? Not sure if that's possible with GNet...