Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / More than one call SendHTTPRequestAsync causes program to freeze on exit if server not available

Author
Message
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 22nd May 2013 00:42
In testing my chat client I took the server offline so that I could work on the handling of queuing messages to be sent when the server is unreachable.
What I found out is that if you make multiple calls to SendHTTPRequestAsync and there's no server response then the program locks up for a bit of time dependent on how many calls you've made. If you make more than one call to SendHTTPRequestAsync to an nonworking server then when you go to exit the program it also hangs a bit.

If anyone would be able to see if the below code acts similar, I'd be appreciative:


Also if anyone has any ideas on how to deal with this I'd appreciate it too. I'm thinking that I might need to send an initial request to the server to see if I get a response and then I can proceed with opening and sending a message, however, this is far from ideal since at anytime the server could go down and I'd literally have to check every time before a message is sent. That sort of destroys the asynchronous transfer. Basically, my chat client would read the chat log at launch and put a message in any array of messages being sent with the above function. So if you have 10 unsent messages the pipeline immediately clogs next time the log is read if the server is down. It seems to me that better handling of the async request by AppGameKit might be in order.

What do you folks think?

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd May 2013 04:17
You should probably avoid sending a message if one has been sent but not had a response back.

I wouldn't be at all surprised if the AppGameKit engine only handled one Asynch request at a time (from initial send to returning 'finished').

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 22nd May 2013 15:47
Thanks. It seems that is the only solution.

Login to post a reply

Server time is: 2024-05-04 19:29:16
Your offset time is: 2024-05-04 19:29:16