RoyZeng / flerry

Automatically exported from code.google.com/p/flerry
0 stars 0 forks source link

End of File Error #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Send lots of messages back-to-back from Java to Flex (see attached zip)

What is the expected output? What do you see instead?
Expect it to be able to handle large amounts of traffic, but instead a End of 
File error will occur at random times.

What version of the product are you using? On what operating system?
using the latest build of flerry with Flex 4.1 and AIR 2 RC on Mac OSX 10.6

Please provide any additional information below.
AIR's buffer splits up messages between frames. A better messaging approach 
would be to append the number of bytes that the message contains to the front 
of the message and then use that on the Flex end to stitch messages together 
over multiple frames.

I modified the demo to demonstrate this error.  I have Flex send a number to 
java and then java increments it by one. When the result gets back to Flex I 
have it tell java to add one and so on over and over again.  The EOF error 
occurs at variable amounts of time.  Sometimes it takes me 10,000 messages to 
get it, other times it takes me 300.

Original issue reported on code.google.com by nros...@gmail.com on 3 Jul 2010 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
This was fixed with 1.2.0 release. Most likely fix came with BlazeDS 4.0 AMF 
serialization libraries.

Original comment by Piotr.Walczyszyn on 2 Aug 2010 at 2:58

GoogleCodeExporter commented 9 years ago
Looks like someone implemented a message delimiter that is attached to each 
message to help distinguish between messages. This approach appears to work 
fine although it is not as robust as a message length process like I 
recommended. The delimiter is currently set to 4 bytes with values 99, 99, 99, 
99. If there is a possibility that the amf data contains 4 bytes with the same 
values, the message will be delimited unnecessarily which would cause messages 
to be lost.

Just a suggestion. Nice job on releasing 1.2!

Original comment by nros...@gmail.com on 2 Aug 2010 at 3:43

GoogleCodeExporter commented 9 years ago
Your suggestion is valid and I think we will implement it this way in next 
release of flerry. You can always join the project and give us a help with this 
one ;)
Piotr

Original comment by Piotr.Walczyszyn on 3 Aug 2010 at 9:02