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">&lt;<a href="mailto:kindernade@gmail.com">kindernade@gmail.com</a>&gt;</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>
&gt; Hi All,<br>
&gt;<br>
&gt; I&#39;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>

&gt;<br>
&gt; ClientBootstrap bootstrap = new ClientBootstrap(<br>
&gt;                 new NioClientSocketChannelFactory(<br>
&gt;                         Executors.newCachedThreadPool(),<br>
&gt;                         Executors.newCachedThreadPool()));<br>
&gt;<br>
&gt; bootstrap.setPipelineFactory(new ClientPipelineFactory());<br>
&gt;<br>
&gt; ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port));<br>
&gt; Channel ch = future.awaitUninterruptibly().getChannel();<br>
&gt; ch.write(array);<br>
&gt;<br>
&gt; Albert<br>
</div></div>&gt; _______________________________________________<br>
&gt; netty-users mailing list<br>
&gt; <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
&gt; <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>