You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Sean Thayne <se...@skyseek.com> on 2014/04/08 21:35:10 UTC

AS3 Workers, End of File errors

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

Re: AS3 Workers, End of File errors

Posted by Sean Thayne <se...@skyseek.com>.
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 <se...@skyseek.com> 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" <ah...@adobe.com> 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" <se...@skyseek.com> 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" <fl...@gmail.com> 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 <se...@skyseek.com> 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 <fl...@gmail.com>
>> >> wrote:
>> >> >
>> >> > > Please do tell us when you found the root cause, thanks.
>> >> > >
>> >> > >
>> >> > > On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com>
>> >>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 <
>> flashflexpro@gmail.com>
>> >> > > wrote:
>> >> > > >
>> >> > > > > bytesarray.position = 0 before read again?
>> >> > > > >
>> >> > > > >
>> >> > > > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com>
>> >> > 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
>> >> > > > > >
>> >> > > > >
>> >> > > >
>> >> > >
>> >> >
>> >>
>>
>>

Re: AS3 Workers, End of File errors

Posted by Sean Thayne <se...@skyseek.com>.
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" <ah...@adobe.com> 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" <se...@skyseek.com> 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" <fl...@gmail.com> 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 <se...@skyseek.com> 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 <fl...@gmail.com>
> >> wrote:
> >> >
> >> > > Please do tell us when you found the root cause, thanks.
> >> > >
> >> > >
> >> > > On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com>
> >>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 <flashflexpro@gmail.com
> >
> >> > > wrote:
> >> > > >
> >> > > > > bytesarray.position = 0 before read again?
> >> > > > >
> >> > > > >
> >> > > > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com>
> >> > 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
> >> > > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
>
>

Re: AS3 Workers, End of File errors

Posted by Alex Harui <ah...@adobe.com>.
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" <se...@skyseek.com> 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" <fl...@gmail.com> 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 <se...@skyseek.com> 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 <fl...@gmail.com>
>> wrote:
>> >
>> > > Please do tell us when you found the root cause, thanks.
>> > >
>> > >
>> > > On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com>
>>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 <fl...@gmail.com>
>> > > wrote:
>> > > >
>> > > > > bytesarray.position = 0 before read again?
>> > > > >
>> > > > >
>> > > > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com>
>> > 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
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>


Re: AS3 Workers, End of File errors

Posted by Sean Thayne <se...@skyseek.com>.
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" <fl...@gmail.com> 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 <se...@skyseek.com> 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 <fl...@gmail.com>
> wrote:
> >
> > > Please do tell us when you found the root cause, thanks.
> > >
> > >
> > > On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com> 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 <fl...@gmail.com>
> > > wrote:
> > > >
> > > > > bytesarray.position = 0 before read again?
> > > > >
> > > > >
> > > > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com>
> > 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
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: AS3 Workers, End of File errors

Posted by Gary Yang <fl...@gmail.com>.
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 <se...@skyseek.com> 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 <fl...@gmail.com> wrote:
>
> > Please do tell us when you found the root cause, thanks.
> >
> >
> > On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com> 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 <fl...@gmail.com>
> > wrote:
> > >
> > > > bytesarray.position = 0 before read again?
> > > >
> > > >
> > > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com>
> 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
> > > > >
> > > >
> > >
> >
>

Re: AS3 Workers, End of File errors

Posted by Sean Thayne <se...@skyseek.com>.
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 <fl...@gmail.com> wrote:

> Please do tell us when you found the root cause, thanks.
>
>
> On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com> 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 <fl...@gmail.com>
> wrote:
> >
> > > bytesarray.position = 0 before read again?
> > >
> > >
> > > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com> 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
> > > >
> > >
> >
>

Re: AS3 Workers, End of File errors

Posted by Gary Yang <fl...@gmail.com>.
Please do tell us when you found the root cause, thanks.


On Tue, Apr 8, 2014 at 3:54 PM, Sean Thayne <se...@skyseek.com> 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 <fl...@gmail.com> wrote:
>
> > bytesarray.position = 0 before read again?
> >
> >
> > On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com> 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
> > >
> >
>

Re: AS3 Workers, End of File errors

Posted by Sean Thayne <se...@skyseek.com>.
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 <fl...@gmail.com> wrote:

> bytesarray.position = 0 before read again?
>
>
> On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com> 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
> >
>

Re: AS3 Workers, End of File errors

Posted by Gary Yang <fl...@gmail.com>.
bytesarray.position = 0 before read again?


On Tue, Apr 8, 2014 at 3:35 PM, Sean Thayne <se...@skyseek.com> 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
>