Is there a complete example sending and receiving files with StreamWriteFilter? I think I see where the problem may be in my code. It looks like Im bypassing the ProtocolCodecFilter as designed, but a single file sent from the server to the client results in multiple messageReceived events on the client. I guess I had assumed it would work like the ProtocolCodecFilter where a single messageReceived event is generated per each object that's decoded.
If the StreamWriteFilter generates multiple messageReceived events per single file sent... Then I need to do things a bit differently... I.e, keep receiving data and maintain the fileoutput object open or append to it until I'm done receiving data. Any pointers on how to go about doing this or links to examples? I'm not quite sure on how to tell when I'm done receiving data. On 11/25/11 1:10 PM, "Cesar Barria" <ce...@barria.org> wrote: >I guess I'm still somewhat confused. If I use each filter independently... >That is, if I only have the ObjectSerializationCodec filter and my app >only sends/receives POJO objects... Everything works right. If I only use >the StreamWriteFilter and my app only sends/receives files... Everything >works right. So, I need to make sure that ObjectSerializationCodec only >deals with POJO and StreamWriterFilter only deals with files. This is >where I'm having an issue... I could add/remove filters from the chain, >but I don't like that option. There should be a way to bypass a filter >when I want to... I.e, if receiving files... Bypass >ObjectSerializationCodec. > >On 11/25/11 12:35 PM, "Emmanuel Lécharny" <elecha...@apache.org> wrote: > >>On 11/25/11 5:53 PM, Cesar Barria wrote: >>> I thought that's what StreamWriterFilter is supposed to do. This is how >>>I >>> was hoping it would work: >>> >>> FilterChain >>> >>> >>> LoggingFilter >>> ObjectSerializationCodec >>> StreamWriterFilter >> >>You can't. It's not about decoding an Objet *and* a stream, but about >>decoding an Object *or* a Stream. >> >>-- >>Regards, >>Cordialement, >>Emmanuel Lécharny >>www.iktek.com >> >> > > >