Hi guys and gals. I'll try and keep this as concise as possible while giving all the necessary details. This is regarding a game but I believe that this isn't necessarily a 'game' issue.
So I'm essentially making an Android game which communicates to a server (which is now my computer). The app will continuously request for updates from the server, and the server will collect the current game status and send it back to the client.
So, I got everything working while using a local ip. Then I investigated how to make a server out of my computer (This part I am very new to). So I used noip.com to set up a host dns, and set port forwarding on my router to send all data going to the port to my PC.
So now it's at the point where the android devices communicate to my PC through the hostname. However, after about a minute or so, the android device will send a message, but it will take 1-2 seconds for the server to see it. Then shortly after this begins, the connection will hang for 15-20 seconds at a time.
Things I've ruled out so far:
1) I've tried using my outside ip to send the messages instead of the hostname, same problem.
2) Doing a speedtest, I have 30 mb down and 6 mb up, so I think that's ok. These messages are presumably much smaller than other games (50 bytes back and forth) and I do a good amount of online gaming with no issue.
3) ping testing the hostname for an hour and the highest ping time was 2ms, which is much less than what I'm seeing.
4) I did confirm that neither side is hanging up, the android device is sending the message and then waits for the return, and the server is still waiting to see the message.
5) Switching back to localhost and I don't have this lag issue whatsoever.
6) I did some research on windows firewalls to confirm as best I can it's not interfering.
I'll gladly share any code/network information I can provide, but I'm not sure what would be beneficial right now, given the clues I have.
My next test will be testing this on a raspberry pi, but that will wait until tomorrow.
Thanks. :D