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 / Http connection to a (localhost) servlet working in android but not in windows

Author
Message
ekureuil
9
Years of Service
User Offline
Joined: 12th Mar 2015
Location:
Posted: 12th Mar 2015 22:02
Hi

I want to communicate with a servlet (which will handle the leaderboard of my app), and as such I first tested a really simple servlet that display a string when called.

The servlet is working fine when used from a browser, but AppGameKit seems to have some problem accessing it.

I used the basic code given with the documentation to try to connect to my servlet with mixed success:

+ from windows, I can connect to, say "google.com", but I cannot connect to my servlet located on 'localhost:8080' (remember: i can access it correctly from any browser)

+ from android, if I change 'localhost' to my actual ip, it works.

+ from windows, changing 'localhost' to '127.0.0.1' or my actual ip, does not work.

+ from windows, I also tried to access my servlet from a java application doing roughly what AppGameKit should do, and it works fine.

By not working, I mean that the response is a null string, and NO sign of connection is shown in the tomcat logs (Tomcat is the application server I use to run the servlet).

I am using the Tier 1 language.

For reference purposes, I will post my code, but it is really basic, so I don't think the problem lies here ...



Any idea ?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Mar 2015 00:32
hmm, do you allowed access through firewall and still does not work in windows?
i don't know if szHost allow include a port no.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Mar 2015 01:51
I'm not sure but it may be that the HTTP API we use on Windows ignores the :8080 and instead uses port 80 for HTTP connections.
ekureuil
9
Years of Service
User Offline
Joined: 12th Mar 2015
Location:
Posted: 13th Mar 2015 13:05 Edited at: 13th Mar 2015 17:30
Firewall is desactivated.

And I tested it with portquiz.net:8080, it works fine with that website, so I would say that port can work (at least on some website).
ekureuil
9
Years of Service
User Offline
Joined: 12th Mar 2015
Location:
Posted: 13th Mar 2015 15:25
Although accessing portquiz.net:8080 was working fine, I tested to set my tomcat server on port 80, and it indeed work fine with that port.

If ":port" is not supposed to work, this should be documented.

If ":port" is supposed to work, there might be a bug in the port management in windows.
ekureuil
9
Years of Service
User Offline
Joined: 12th Mar 2015
Location:
Posted: 13th Mar 2015 15:27 Edited at: 13th Mar 2015 17:28
Oh, and I forgot: i also tested setting my tomcat server on the port 8090, instead of 8080, and it also did not work with windows but worked fine with android.

Login to post a reply

Server time is: 2024-11-25 18:48:45
Your offset time is: 2024-11-25 18:48:45