[JDEV] Flash 5's XMLSocket vs Jabber 1.2

Oliver George oliver at littledevil.com.au
Mon Oct 16 01:13:49 CDT 2000


Hi all,

I have two problems in directly interfacing between my flash 5 applet (which includes a XMLSocket object) and jabber.  They are described below.

I hope this email is useful to anyone else trying the same thing as me.  I'm also hoping someone can comment on wether the first problem is a jabber server bug (because then it could be fixed and my problem would go away :) ).

The new version of jabber looks great, good work guys.

- Oliver.


Problem 1: Null characters...
=================================
null characters are sent between each transmission from the client.  This causes the server to crash.  My question is: should jabber client stream be tolerant to null characters (ie. 0x00).

If the server can't be made to tolerate this then i would probably need an interface socket which reads from the flash client, translates (removes nulls) and sends to the server.  This is bad because i now have 3 sockets open for a single connection.

Just to emphasise this problem here is a ngrep dump of my flash client sending a message to the server.  Notice the 00 which trails the <stream...>

-----------------------
T 192.168.1.14:1821 -> 192.168.1.1:5222 [S]

T 192.168.1.1:5222 -> 192.168.1.14:1821 [AS]

T 192.168.1.14:1821 -> 192.168.1.1:5222 [A]

T 192.168.1.14:1821 -> 192.168.1.1:5222 [AP]
  3c 73 74 72 65 61 6d 3a    73 74 72 65 61 6d 20 74    <stream:stream t
  6f 3d 22 64 65 76 69 6c    6d 61 73 6b 22 20 78 6d    o="devilmask" xm
  6c 6e 73 3d 22 6a 61 62    62 65 72 3a 63 6c 69 65    lns="jabber:clie
  6e 74 22 20 78 6d 6c 6e    73 3a 73 74 72 65 61 6d    nt" xmlns:stream
  3d 22 68 74 74 70 3a 2f    2f 65 74 68 65 72 78 2e    ="http://etherx.
  6a 61 62 62 65 72 2e 6f    72 67 2f 73 74 72 65 61    jabber.org/strea
  6d 73 22 3e 00                                        ms">.

T 192.168.1.1:5222 -> 192.168.1.14:1821 [A]

T 192.168.1.1:5222 -> 192.168.1.14:1821 [AF]

T 192.168.1.14:1821 -> 192.168.1.1:5222 [A]
-----------------------


Problem 2: Flash callback onTag event can't handle depth
=============================================================
a normal jabber stream would only give a single callback when the stream tag is finally closed.  I got around this really easily with the new server architecture (thanks heaps to mass/akuma/dave for the help).  

Basically i listened on a new port which used a copy of xstream_header_char which didn't remove the '/' from the '/>'.  (just incase anyone is interested)





More information about the JDev mailing list