users@grizzly.java.net

question on comet and Transfer-Encoding: chunked

From: Bill Robertson <bill_at_tekbot.com>
Date: Sat, 1 Nov 2008 22:07:42 -0700 (PDT)

I have a situation where I am streaming comet responses. When I send each
message, glassfish or grizzly appears to be chunking them.

e.g.

send a 33 byte message: 00028{"fu":"bar","messageId":"1"}
flush the output stream
send a 34 byte message: 00029{"fu":"bar2","messageId":"2"}
flush the output stream

The client receives this...

21\r\n
00028{"fu":"bar","messageId":"1"}\r\n
22\r\n
00029{"fu":"bar2","messageId":"2"}\r\n

21 (hex) == 33, so these are the message sizes.

Chunking is new to me, so this is a bit of a surprise. I don't mind the
behavior, but I would like to know if I can count on it happening? In other
words, can I take my length calculations out of the code and then tell 3d
party clients to expect this the chunking behavior? Will I get burned
because the behavior in glassfish/grizzly might change? Also, is there a
maximum chunk size? i.e. could glassfish end up chunking in the middle of
my message?

BTW, this is the version of glassfish that was included in Netbeans 6.5 RC1.

Thanks!

-- 
View this message in context: http://www.nabble.com/question-on-comet-and-Transfer-Encoding%3A-chunked-tp20287189p20287189.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.