We've recently added new support for streaming objects in Hessian 2.0.
The basic underlying Hessian protocol is the same, but objects may be
broken into "messages".  There is a new production for messages:

          # message/streaming message
message   ::= ('p' b1 b0 data)* 'P' b1 b0 data

The lower case 'p' indicates a non-terminal packet and the upper case
'P' indicates a terminal packet.  The b1 b0 bytes indicate the length of
the packet.  The data is simply a portion of a Hessian stream.  

Let's look at an example.  Say you have a simple Hessian 2.0 string:

\x04test

We could send this several ways using the streaming packets.  First we
could send it as a single packet:

P\x00\x05\x04test

This is a terminal packet where the data is of size 5.  We could also
break this string up over several packets:

p\x00\x01\x04
p\x00\x02te
P\x00\x02st

Here the first packet has 1 byte: the length of the string, the
second packet has two bytes, the first two characters of the string,
and the final packet has two bytes, the last two characters of
the string.  Normally, we wouldn't break up a small object like a
four character string, but rather a larger, more complicated object.

So why would we want this in the protocol?  This allows us to stream
objects as events to receivers.  Now Hessian can be used as the
protocol for server-push applications.

We have an example of just such a server-push application here: 

  http://hessian.caucho.com/comet/

This demonstration uses the new Comet API in Resin and the Java
implementation of Hessian on the server side and the Flash
implementation of Hessian on the client.  New data is streamed from the
server to the client, which picks up the objects and treats them as
events.

Please let us know your comments, questions, and suggestions.

Best,
Emil

============================================================

Emil Ong
Chief Evangelist
Caucho Technology, Inc.
Tel. (858) 456-0300
mailto:[EMAIL PROTECTED]

Caucho: Reliable Open Source
--> Resin: application server
--> Quercus: PHP in Java
--> Hessian Web Services


_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to