BlueBox handling of string protocol

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

Posts: 1
Joined: 02 Apr 2009, 15:01

BlueBox handling of string protocol

Postby asmarot » 02 Apr 2009, 15:23


We have a SmartFox server and decided to try the BlueBox as a fallback when the users are behind a firewall that is too restrictive.
Our application is complex and various messages are transmitted back and forth using both string and XML protocols.
The blue box (the older version that we have) almost worked from the first run but we had a problem:

Some messages are XML or XML-like but are transmitted through string protocol. And there is the problem. From what we see in the client code messages are being split on newline and sometimes merged back. However when the current line does not begin with '<' the line is considered a single message and is not joined to the lines before or after. Thus our XML messages sent over string protocol get split badly. For example:

Code: Select all

%xt%enterH%-1%<room backgnd="screens/home0.swf" engine="engines/new.swf" icon="" id="_hr4" name="Home" owner="new2" type="livingroom">
 <include id="_activities_"/>
<point>default: 630, 380</point>

is split into two messages instead being merged into one.

With the newest bluebox the problem is even worse, as it does not merge back messages that get split and most of our XML has newlines in it.
User avatar
Site Admin
Posts: 21603
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 03 Apr 2009, 12:58

The newline character is used by the BlueBox to separate multiple messages that are sent at once to the client.
So, that character can't be used in your XML.

We thought of introducing a configurable separator but it could lead to unexpected behaviors due to the HTTP transport protocol, so at the moment we're a little reluctant to introduce it.

Anyways there's an easy workaround that you can use, by encoding your newlines to any other printable character or sequence of printable character and then convert them back.

p.s. = new lines in XML are negligible so why not simply avoiding them at all? You would also save a bunch of bytes
...addicted to flash games

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 2 guests