I ran the test. .shareable must have some other special magic in it. I saved them to a local vector before passing them through the channel to keep reference on them to avoid being GC'd. Still got some empty messages.
-Sean Thayne On Tue, Apr 8, 2014 at 11:41 PM, Sean Thayne <[email protected]> wrote: > Interesting idea. Tomorrow, I will add them to a local array before > sending them over the channel, and see what happens. > On Apr 8, 2014 11:19 PM, "Alex Harui" <[email protected]> wrote: > >> Any chance the byte array was getting garbage collected and making >> sharable prevents it from being collected? >> >> On 4/8/14 8:34 PM, "Sean Thayne" <[email protected]> wrote: >> >> >Ya, positive. After switching to sharable, problem was solved. Before >> that >> >most of the time it just worked, no problem. Just randomly would get zero >> >length byte arrays. >> > >> >I'm using air 4.0 btw. >> >On Apr 8, 2014 9:00 PM, "Gary Yang" <[email protected]> wrote: >> > >> >> I use MessageChannel all the time for months, and I have never >> >>encountered >> >> such a problem, are you sure the bytearray you sent is not 0 in length? >> >> >> >> >> >> On Tue, Apr 8, 2014 at 6:19 PM, Sean Thayne <[email protected]> wrote: >> >> >> >> > Looks like the fix was ByteArray.shareable = true, on all messages >> >>being >> >> > sent over the channel. I hadn't thought that was necessary, as I was >> >> > expecting a copy of the ByteArray would happen. And 99% of the time, >> >>it >> >> > did. Just randomly wouldn't send it.. which is weird, but anyways, >> >> > shareable = true solved my issue and it's running stable now. >> >> > >> >> > Thanks >> >> > >> >> > -Sean Thayne >> >> > >> >> > >> >> > On Tue, Apr 8, 2014 at 2:04 PM, Gary Yang <[email protected]> >> >> wrote: >> >> > >> >> > > Please do tell us when you found the root cause, thanks. >> >> > > >> >> > > >> >> > > On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <[email protected]> >> >>wrote: >> >> > > >> >> > > > Ya, I've tried that, the thing is that the ByteArray.length is >> >>zero. >> >> > > > >> >> > > > -Sean Thayne >> >> > > > >> >> > > > >> >> > > > On Tue, Apr 8, 2014 at 1:38 PM, Gary Yang < >> [email protected]> >> >> > > wrote: >> >> > > > >> >> > > > > bytesarray.position = 0 before read again? >> >> > > > > >> >> > > > > >> >> > > > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <[email protected]> >> >> > wrote: >> >> > > > > >> >> > > > > > Hi, >> >> > > > > > >> >> > > > > > Has anybody ran into end of file errors when using the >> >> > MessageChannel >> >> > > > > > classes with workers? >> >> > > > > > >> >> > > > > > Sometimes (randomly) the message that are sent over the >> >> > > MessageChannel >> >> > > > > are >> >> > > > > > empty. Which causes Error #2030 Unexpected End of File. >> >> > > > > > >> >> > > > > > >> >> > > > > > -Sean Thayne >> >> > > > > > >> >> > > > > >> >> > > > >> >> > > >> >> > >> >> >> >>
