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 / Issues with GetHTTPResponseReady on Mac, but working on Windows.

Author
Message
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 27th May 2015 14:39
Has anyone run into issues using the HTTP functionality with AGK2,14b?

I have a function that works smoothly on Windows, the GetHTTPResponseReady returns 1 when the response is ready, and it proceeds with the rest of the game, but when I open the project in AppGameKit on my Mac, the GetHTTPResponseReady will always return a 0, constantly, leaving it in and endless loop.

Just wondering why Windows will return a 1 and Mac will not?

Thoughts?

Robert Janes (Samu Games)
http://www.samugames.com/artifact
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 27th May 2015 14:57
I know the POST data is being received on the web server because the new entry for the user is made on my Database, but echo-ed string being returned only works when I'm testing it on AppGameKit on Windows. It should simply echo "Success" and it does when testing on my Win8 machine. On my Mac however, the database entry is made successfully server side, but the GetHTTPResponseReady never returns anything, always 0.

Robert Janes (Samu Games)
http://www.samugames.com/artifact
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th May 2015 19:53
how bizarre, I just got the same problem on Android. I don't know if you can test on Android too?

On Windows, it is instantaneous. On Android, it times out after the 10 seconds I set with no response.

I am using 2.0.13

I'll send my code to Paul.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 27th May 2015 20:41
Indeed same issue on Android, Windows is the only working device.

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 27th May 2015 21:17 Edited at: 27th May 2015 21:19
This is odd, because the leaderboards seem to work fine on Android.
Don't they send the data back in this way???

Edit
OOPS
Never mind, I am not using v2 yet. (still using 1.8 I think)


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 27th May 2015 22:48
I would have to go back and install an older version (1.8) to test there, but I would hate to step backwards in the IDE.

Hopefully the TGC team looks into this and finds a solution, it's pretty much a show stopped at the moment.

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 28th May 2015 03:10 Edited at: 28th May 2015 03:11
Quote: "Hopefully the TGC team looks into this and finds a solution, it's pretty much a show stopped at the moment."

Well, if Paul had it working in earlier versions, then it can't be too difficult for him to get it working again.
Hopefully it is a minor side-effect of a new feature that was unforeseen, but easy to correct quickly.
Just keep working on other things until it is fixed then come back to this part, because I doubt it will take long to get it sorted out.
I'm sure the next update will have a fix for this.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 28th May 2015 03:19
Indeed! Thankfully it's working properly on Windows, so I can continue development on that for now, I'm just at a stage where I need to do some performance testing on other devices.

Fingers crossed!

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 28th May 2015 11:59 Edited at: 28th May 2015 20:10
I can replicate the bug on Android, all I can tell so far is it's something to do with the SSL connection failing for some reason. AppGameKit on Android supports TLS 1.0 and TLS 1.1 using cURL with the axTLS library, but I spent some time updating both to the latest version and it still fails with "alert internal error". The error is from the server rejecting the connection and seems to happen with some servers but not others. It could be that the server doesn't support the ciphers supported by axTLS, but using stand alone OpenSSL to test the connection is getting the same error and it definitely does support the necessary ciphers. So I'm not sure what's going on yet.

Edit: In BatVink's case it was due to the server using multiple domains per SSL certificate (such as those used by CloudFlare), which Android didn't handle properly, and the server not accepting RSA as a cipher, which is required by our SSL library on Android. I can't replicate and problems on Mac.
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 28th May 2015 22:48
Interesting, The web server I'm using is a Windows box with IIS and no SSL certificate. I wonder if that's where the problem lies?

Robert Janes (Samu Games)
http://www.samugames.com/artifact
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th May 2015 00:08
If there is no SSL certificate but you are using a https address, it will almost definitely fail.

One thing Paul pointed out to me which I hadn't realised is that the command returns a -1 on error. I was checking for "1" so I never dealt with the "-1" which would have given me a little more insight into what was happening.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 29th May 2015 00:17
No, I wasn't using an https address, just a regular http:// address.

I've tried -1 as well, but it returns nothing other than 0.

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th May 2015 00:51
I haven't seen any problems with standard HTTP connections, if you're willing to share the address you are connecting to I'll try out a few connections and see if I replicate the problem.
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 29th May 2015 00:57
www.canadianparamedicjobs.ca/game/loadplayer.php?Name=Robert&Password=test

is the connection string.


UserName = "Robert"
Passowrd = "test"
http = CreateHTTPConnection()
SetHTTPHost( http, "www.canadianparamedicjobs.ca", 0 )
SendHTTPRequestASync( http, "game/loadplayer.php", "Name=" + UserName + "&Password=" + Password)

Works while testing on Windows, not on any other device.

It should simply return "Success" if successful login, or failed if the password is incorrect, or account does not exist if the database entry isn't found.

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th May 2015 01:15
Tested on Windows, Mac, and Android and they all connected and displayed both the success response and the account not found response. Although I did have to set the timeout a little higher in some instances as it took a while to reply. The default timeout is 6000 milliseconds, using SetHTTPTimeout(ID,10000) seemed to be more reliable.
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 29th May 2015 01:26
I'm out at supper at the moment. I'll try the timeout timer and see if that helps the issue, I hadn't set it previously. However if it timed out would it remain as 0 or return a -1?

You make me think that it's perhaps my code, but it's fully functional on Windows. Then I thought it was my development environment but why would it fail on my iPhone and my Mac? But it could be timing out! Never considered upping the timer.

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th May 2015 02:21
A time out will result in a -1 error, but there is one difference between Windows and the other platforms that might explain your results. When waiting on GetHTTPResponseReady you must continue to call Sync or Swap like so

Windows doesn't care and will eventually connect anyway, but Mac, Android, and iOS will loop forever and never connect unless you call Sync or Swap to relinquish control of the thread.
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 29th May 2015 03:24
Increasing the timeout() AND adding Sync() resolved the problem!

Robert Janes (Samu Games)
http://www.samugames.com/artifact

Login to post a reply

Server time is: 2024-11-25 21:49:41
Your offset time is: 2024-11-25 21:49:41