简体   繁体   中英

actionscript socket communication with different language

when using Socket class to make connection with server, how actionscript transform data to server with different language implementation? The server may implement in .NET, ruby, or java, the following is the code example:

private function test():void {
    socket = new Socket();
    socket.addEventListener(Event.CONNECT, onConnection);
    socket.connect("localhost", 8888);
}

private function onConnection(event:Event):void {
    trace("Connected to server");
}

when I use java implements the server side, why and how actionscript "know" the way to communicate with java(what if using .NET implements the serverside), does it mean actionscript "clever enough to know the server side language?". what if write customer object to socket(and how), and server responds to actionscript. Could anyone explain the mechanism or recommend some material about these topic?

I know this is an old thread, but for the good of internet information (google brought me here) I'm going to post a reply.

See, the language really does not matters in the end you will be transmiting data packets, like byte arrays, objects, streams or so.

What you need to worry about is that both sides understand the same type of data, but that is quite simple if you are doing both parts.

Dealing with actionscript sockets have been a headache for me, I can get a single packet read nor sent from it, really adobe pissed me off today, how can a simple socket connection can be so hard!?

Good luck with whatever you are doing :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM