Thank you very much Bruno. Now it works like a charm :).<br><br><div class="gmail_quote">On Thu, May 19, 2011 at 10:19 AM, Bruno de Carvalho <span dir="ltr"><<a href="mailto:kindernade@gmail.com">kindernade@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Given that your pipeline is empty - no encoders, decoders or handlers - the only supported object you can send to a Channel.write() call is a ChannelBuffer.<br>
<br>
Use ChannelBuffers.wrappedBuffer(array) to wrap array (assuming array is [B) in a ChannelBuffer.<br>
<br>
<br>
Cheers,<br>
Bruno<br>
<div><div></div><div class="h5"><br>
<br>
On May 19, 2011, at 3:06 PM, Albert Nikola wrote:<br>
<br>
> Hi All,<br>
><br>
> 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.<br>
><br>
> ClientBootstrap bootstrap = new ClientBootstrap(<br>
> new NioClientSocketChannelFactory(<br>
> Executors.newCachedThreadPool(),<br>
> Executors.newCachedThreadPool()));<br>
><br>
> bootstrap.setPipelineFactory(new ClientPipelineFactory());<br>
><br>
> ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port));<br>
> Channel ch = future.awaitUninterruptibly().getChannel();<br>
> ch.write(array);<br>
><br>
> Albert<br>
</div></div>> _______________________________________________<br>
> netty-users mailing list<br>
> <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<br>
<br>
_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
</blockquote></div><br>