actionscript 3 - Flex & Java socket programming -
i new flex. please can 1 give flex socket programming example both sides flex , java
i trying objectoutputstream in java server side , java client side work fine.
but in flex fail read & write object in stream please can 1 can me?
flex , java possible.
i have a flex , perl multiplayer card game (for desktop , mobile) , works fine since 4 years already.
for game send gzipped json data using writeutf actionscript method (i use com.brokenfunction.json.encodejson historical reasons, use native json function):
try { // send length of string in bytes followed string _socket.writeutf(encodejson(obj, null, true, true)); _socket.flush(); } catch(e:error) { trace('fetch socket send: ' + e); }
on server side first read 2 bytes containing data length.
also have handle adobe socket policy , can use my open sourced apache module written in c (for easier start there a perl script included).
Comments
Post a Comment