Hi All,
I may be asking a bit much here but I have faith in the community so it's worth trying. I'm making a game and I'm trying to pick the connection type to use for communicating between a Java mobile client and a Java server backend.
Socket programing in Java is easy - there's a lovely tutorial on the subject and two way communication is trivial.
Trouble is that on a mobile client (Android) it's not guaranteed that the cellular network will let you make TCP connections. That makes me think using an HTTP connection is the way to go.
HTTP connections are request based but I need a way to push notifications from the server to the client. It seems the solution to this problem is to use 'long polling' I have read a bit about it but have yet to see a simple example for what I'm trying to achieve.
Again I might be asking a lot but this seems like a fairly common problem, is there a library or framework I can import / use to wrap a Http connection and provide a two way long standing connection (That reconnects automatically etc). I read a bit about cometD but it doesn't seem to have a Java library that I can just pick up.
The communication I need is not heavy, not constant two way streams of data just occasional updates either way to keep the game going.
Thanks in advance for sifting through my ignorance,
Gavin