java - Libgdx GWT WebSocket Object Serialization -
background: i'm working on side-project (game) goals of learning libgdx (using javascript/html5 deployment) , figuring out client/server communication in environment (a seemingly unpopular combination).
network communication: coming kryonet background (and since kryonet incompatible gwt), have landed on gwt-web-sockets-1.0.0 (a java gwt wrapper javascript websockets) network communication (which perfect me since i'm comfortable in java).
with use of gwt-web-sockets-1.0.0 library can communicate client -> server using follwing native call:
problem: skeptical of scalability of above send() method. kryonet serializes classes , supports sending respective serialized instances (ex: sending player instance). above implementation, i'm given work sending data type string. have found js wrapper implementation sksamuel in implements practically same thing gwt-web-sockets-1.0.0 except takes 1 step further , adds binary support.
question: ideally, i'd able implement similar kryonet - serializing , sending objects natively through java (gwt-compatible). if isn't possible, i'm guessing next best solution add layer above described send(string data)
and/or send(byte[] data)
methods network communication. perhaps send(serializer.convert(data))
-- data player object converted either string or byte[] expected argument of native send() method) compatible gwt.
as always, can provide.
Comments
Post a Comment