Stream corruption with multiple producers

Shay Banon kimchy at gmail.com
Sun Dec 27 08:34:40 EST 2009


In the TestServer, instead of adding handlers to the pipeline of the
bootstrap, you need to add a pipeline factory, that will create the pipeline
you want. Something like:

        ChannelPipelineFactory serverPipelineFactory = new
ChannelPipelineFactory() {
            @Override public ChannelPipeline getPipeline() throws Exception
{
                ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("encoder", new StringDecoder());
 pipeline.addLast("decoder", new StringEncoder());
pipeline.addLast("handler", new TestHandler());
                return pipeline;
            }
        };

And then do:

        bootstrap.setPipelineFactory(serverPipelineFactory);

Cheers,
Shay

On Sun, Dec 27, 2009 at 1:05 PM, Luis Neves <luis.neves at gmail.com> wrote:

> Hello all,
>
> There seems to be some kind of race condition when using the FrameDecoder.
>
> I've done a simple test case:
>
> <http://dl.dropbox.com/u/279023/netty/TestProducer.java>
> <http://dl.dropbox.com/u/279023/netty/TestServer.java>
>
> When using more than one producer process I immediately get a corrupted
> stream.
> I've tested both the stable 3.1.5 and the recent 3.2alpha2 versions
> with the same results
>
> I maybe doing something wrong, but I can't figure out what.
> Any thoughts?
>
> Thanks!
>
> --
> Luis Neves
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20091227/c154ee41/attachment.html 


More information about the netty-users mailing list