Expand my Community achievements bar.

xmlsocket issue


Former Community Member
I´m creating a flex app on a local network that usses

I can connect to the server-port from other computers but the
dataEvent doesn´t work. I use send and then ofcause expect
some kind of response but nothing happens. This is inside a flex
app that calls putData () on a button.

I used this code for a small server.

private function init():void{

_socket = new XMLSocket();

_socket.connect("", 8080);

_socket.addEventListener(DataEvent.DATA, onData);

_socket.addEventListener(Event.CONNECT, onEvent);

_socket.addEventListener(Event.CLOSE, onError);

_socket.addEventListener(IOErrorEvent.IO_ERROR, onError);


private function onEvent(event:Event):void {

output.text = "connected";


private function onError(event:Event):void {


output.text = "error";


private function onData(event:DataEvent):void {

trace( "GO" );

fromSocket.text = event.toString();


private function putData () :void


var request:String = "<register/>\n";



0 Replies