GOAL: implement a basic client that can communication to a server from a LibGDX/GWT HTML5/JavaScript deployment. This is for a side-project multiplayer online browser-based game.
WHAT I KNOW AND HAVE DONE: All of my networking experience comes from KryoNet (create a server object, start the server, listen for requests, boom you're done) - can this (or a similar) architecture be achieved in a LibGDX/GWT HTML5 deployment?
After doing hours of research I have yet to have any luck with these magical things called "WebSockets" that everyone says to use. The only "WebSockets" I have found are in Gdx.net and they are "Not implemented".
The following code (that is executed in Libgdxclient-core and gets compiled from Libgdxclient-html)
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Net.Protocol;
import com.badlogic.gdx.net.Socket;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Net.Protocol;
import com.badlogic.gdx.net.Socket;
public class Client {
private Socket socket;
public Client() {
Gdx.app.log("create()", "connecting.....");
this.socket = Gdx.net.newClientSocket(Protocol.TCP, "127.168.1.1", 54555, null);
}
}
Produces this output:
I came across a couple of GitHub repositories with regards to WebSocket implementation, however I'm stumped as to which (if any) of them is actually LibGDX/GWT compatible and could really use a hand as to what I need to read up on to accomplish my goal (I'm looking for a pure Java solution).