Connection on Phone

0 votes
Hi,

I have recently moved and since then when trying to test my app on my phone, it will not connect to the server.

The result code from OnConnectDone is 5 and from OnJoindedRoomDone is connection_error. I still have the internet permission in the AndroidManifest and have changed the ip that AppWarp takes to my private ip. I have also tried my public ip, but this freezes my app.
asked Apr 1, 2014 in AppWarpS2 by scott.woolven (35 points)

1 Answer

0 votes
Hi Scott,

Can you clarify what do you mean by "moved"? Are the client (phone) and server machine still on the same private network? Are any other services running on the server machine accessible from the phone (eg: web server)?

How did you get your public IP? Have you hosted the server on some IaaS (like AWS) or is your ISP providing you a static public IP?
answered Apr 2, 2014 by dhruvc (1,099 points)
I have moved house, so I have a different network now.
I am running the server from my laptop using Eclipse and my phone is connected to the same network as my laptop. That used to work before I moved house.
To get my public IP, I just googled it

Thanks, Scott
I see - the public IP that you get from whatismyip.com will not do in this case as your computer is behind a NAT in this case.

Ideally your private IP address of the laptop (10.0.0.X or 192.168.X.X) should work as long as the phone is also connected to the same Wireless LAN. Do ensure that the phone is on WLAN and not using 3G/Edge cellular data as it might not use the correct interface then.
I've turned off mobile data on my phone and connected it to the same network as my laptop, but when using the private IP of my laptop, it still doesn't connect.
Can you telnet in to your server from another machine? The AppWarp S2 server by default runs on port 12346. So try something like the following

>telnet 192.168.1.32 12346

If this fails then it means that either the server process is not running (unable to bind to the port) or the server machine has some firewall installed that is blocking incoming traffic.
I am unfamiliar with Telnet, so let me know if I've done this right...

I enabled Telnet Server on the machine I am running the AppWarp S2 Server on, started the Telnet service and started the AppWarp S2 service. I then enabled Telnet Client on another machine which is connected to the same internet connection, opened the command prompt and entered: telnet 192.168.1.68 12346
It then started connecting but failed after a few seconds.
I then opened the 12346 port on the server machine's firewall but the connection still failed.
You don't need to enable anything on server machine other than running the AppWarp S2 server.

Did you try pinging the server machine from another?

Can you try putting "INFO" as the log level in your AppConfig.JSON file and try to run the server again. Then see the Warplog.log file which is under your Logs folder in the running directory of the server.

You should see the following if everything is fine.

INFO: TCP server started
What exactly do you mean by "pinging the server machine from another"?

I got that line in the Warplog, but the second line looks a bit worrying..

2014-04-05 18:42:40,568 - WARNING: Error in loading license from server java.lang.Exception: no key in AppConfig.json
2014-04-05 18:42:40,572 - WARNING: Running with 500 CCU limit
2014-04-05 18:42:41,126 - INFO: TCP server started
2014-04-05 18:42:41,176 - INFO: UDPServer started
2014-04-05 18:42:41,189 - INFO: started FlashPolicyServer
2014-04-05 18:42:41,191 - WARNING: Error in createHSQLServiceTable java.sql.SQLSyntaxErrorException: object name already exists: SERVICE in statement [CREATE TABLE service(AppKey varchar(20),Secret varchar(20),Name varchar(20),PRIMARY KEY (AppKey))]
2014-04-05 18:42:41,191 - WARNING: Error in createHSQLMteringTable java.sql.SQLSyntaxErrorException: object name already exists: METERING in statement [CREATE TABLE metering(AppKey varchar(20),sent int,received int,name varchar(35))]
2014-04-05 18:42:41,192 - WARNING: Error in createHSQLRoomTable java.sql.SQLSyntaxErrorException: object name already exists: ROOM in statement [CREATE TABLE room(AppKey varchar(20),id varchar(20),maxPlayers int,name varchar(20),properties varchar(500),PRIMARY KEY (AppKey,id))]
By pinging, I mean executing the ping command from the terminal prompt. Type the following

">ping 192.168.1.132"

The output shows you if the machine address is reachable or not from the machine where you are executing the command from. On most PCs/Macs ICMP Ping is enabled by default.

http://en.wikipedia.org/wiki/Ping_(networking_utility)

The ERROR log is benign and can be ignored - it has been removed from our newer builds.
2014-04-05 18:42:41,126 - INFO: TCP server started
means that AppWarp S2 server application is fine and so the issue is with your network setup.
Hi,
This is the log from the cmd run off of another machine:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>ping 192.168.1.68

Pinging 192.168.1.68 with 32 bytes of data:
Reply from 192.168.1.68: bytes=32 time=603ms TTL=128
Reply from 192.168.1.68: bytes=32 time=5ms TTL=128
Reply from 192.168.1.68: bytes=32 time=4ms TTL=128
Reply from 192.168.1.68: bytes=32 time=394ms TTL=128

Ping statistics for 192.168.1.68:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 4ms, Maximum = 603ms, Average = 251ms
Hmm.. so that suggests there is either some issue specifically with port 12346 on the server machine or the client.
By the way, are you able to connect to the AppWarp S2 application from the Admin Dashboard? The AdminDashboard also accesses AppWarp S2 on port 12346 only. Try running this (browser) on a different machine that where your server is running and see if you can create zones and rooms from it.
If this works (i.e. the dashboard) then we can say the problem is with the phone client else its with the server.
I can access the dashboard on the sever machine but it does nothing when I click sign in from another machine.
So the problem is then that your server machine is not allowing incoming connections to port 12346. Please have your system admin look in to why this is. Probably some firewall or anti-virus tool is blocking it. The other thing you can try is  (if you are working with the latest server side SDK) is to change the Listen Port in the AppConfig.json file to something like 80 or another port that you know is opened.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...