I have a Flex 3.0 app which can connect to a remote socket server, and
send it XML, but nothing happens ( no event fires, no error in debugger)
in Flex when the server returns data. The remote server is appending a
nullbyte to the xml message, and thinks its sending the data.
Ideas?
---------------------------------------------------------
the server code ( perl) snippet:
my $NULLBYTE = pack( 'c', 0 );
....
if ( $1 eq "new" ) {
print STDOUT "request is: $1 sending xml data\n";
print CONNSOCK $simdata ;
print CONNSOCK $NULLBYTE;
}
--------------------------------------------------------
the flex code snippet:
| var socket:XMLSocket = *new *XMLSocket();
socket.addEventListener(Event.CONNECT, connected);
socket.addEventListener(DataEvent.DATA, dataReceived);
socket.connect("localhost", 8989);
*private function *connected(event:Event):*void*
{
socket.send(xmldata);
}
*private function *dataReceived(dataEvent:DataEvent):*void*
{
trace(dataEvent.data);
var xml:XML = *new *XML(dataEvent.data);
}
----------------------------------------
Thanks
John
|