• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Need some clarification on XmlSocket.onData

New Here ,
Aug 24, 2015 Aug 24, 2015

Copy link to clipboard

Copied

Hi, I need some clarification about what's happening behind the scenes with the XmlSocket on AMS. The documentation is inconsistent with the behavior I'm seeing. Specifically the documentation states:

XmlSocket.onData(src)

Invoked when a message has been downloaded from the server, terminated by a zero (0) byte. You can override  XMLSocket.onData() to intercept the data sent by the server without parsing it as XML. This is useful if you’re transmitting arbitrarily formatted data packets and you would prefer to manipulate the data directly when it arrives, rather than have Flash Media Interactive Server parse the data as XML.

If I send a string across the connection like "Hello there!", my onData handler never gets called. I did make sure the stream was terminated with a zero byte. I also just tried sending a message with 0 length buffer and,  new lines and carriage return values as well to the ends of my strings all to no avail.

However, when I send a message like "<a>Hello there!</a>", my onData handler does get called. This leads me to believe that there is actually processing for the XML happening before onData is handled. The reason I'm asking, is that we are suffering seg faults while processing XML data, and are trying to get a lock on where/why.

I'm using AMS - 5.0.3 r3029 x64

AS3 Documentation

Adobe ActionScript 3.0 * Socket connections

FMS - XmlSocket Documentation

http://help.adobe.com/en_US/FlashMediaServer/4.0_SSASLR/WS5b3ccc516d4fbf351e63e3d11a11aff5ba-7c8f.ht...

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 26, 2015 Aug 26, 2015

Copy link to clipboard

Copied

Hi,

Are you creating a "flash" type or "stream" type XML socket?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2015 Nov 04, 2015

Copy link to clipboard

Copied

I'm creating a 'stream' type XML Socket.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 18, 2015 Nov 18, 2015

Copy link to clipboard

Copied

Going to keep bumping until I hear something.... Adobe's help on these forums is pretty sad...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 21, 2016 Jan 21, 2016

Copy link to clipboard

Copied

LATEST

Hi,

Sorry for late reply.

There are two types of XML socket - flash type and stream type. For both the cases, if the user defines onData handler, then the user handler gets called. For flash type XML Sockets, you can pass any data and can have any processing on data according to the handler. However for stream type XML Sockets or XMLStreams you need to pass a valid XML data because it checks for opening and closing tags before calling the user defined handler. So, either you create a flash type socket and define onData handler accordingly or pass a valid XML to stream type XML socket.

Hope this clarifies your query. Again very sorry for the inconvenience caused.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines