Simple client-server using framer

Albert Nikola albert.nikola at gmail.com
Thu May 19 10:06:53 EDT 2011


Hi All,

I'm trying to write simple client and server based on length field framer
which passes byte array. However when I try to send the byte array from the
client it shows Unexpected exception in selector look warning and throws
java.lang.IllegalArgumentException: unsupported message type: class [B.
Please give me some tips how do I send raw byte array. Thanks.

ClientBootstrap bootstrap = new ClientBootstrap(
                new NioClientSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

bootstrap.setPipelineFactory(new ClientPipelineFactory());

ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port));
Channel ch = future.awaitUninterruptibly().getChannel();
ch.write(array);

Albert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110519/9bb2cc3b/attachment-0001.html 


More information about the netty-users mailing list