#Send a request in OnApplicationQuit

1 messages · Page 1 of 1 (latest)

muted nexus
#

Hi, i'm using HTTPRequest from BestHTTP and i would like to send a request in the OnApplicationQuit method, but it seems to not send anything. For precision, the method is indeed called, but i'm not receiving the data server side

#

Is there a way to "force" the request to be sent in a blocking way, or just wait for it to send before actually quiting ?

wheat magnet
#

Most likely, your game process is quitting before the request can finish.
To get around this, you can either prevent quitting by hooking into Application.wantsToQuit and retuning false, or by starting a command line program from within OnApplicationQuit, which sends the request in stead of your game.

#

Note that likely neither of those ways will work if the game is quit through the task manager or the computer shutting down; so the request not reaching the server always remains a possibility.

muted nexus
#

oh well, i guess i'll just tweak BestHTTP to make the Request.Send not async