Hi Trustin<div><br></div><div>Yes, I have read the QOTM example and I have tried that with Netty 3.1 BETA1.</div><div><br></div><div>I was thinking that ServerBootstrap generic, and it is applicable for all ChannelFactory.</div>
<div>In this case, I think the ServerBootstrap is applicable with all ChannelFactory except the DatagramChannelFactory?</div><div><br></div><div><br></div><div>I think that is something worth to explain in the Javadoc of ServerBootstrap(ChannelFactory).</div>
<div><br></div><div><br></div><div>Thank you!</div><div><br></div><div><br></div><div><div class="gmail_quote">On Mon, Apr 20, 2009 at 6:31 PM, Trustin Lee <span dir="ltr"><<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">You do not need to use ServerBootstrap for the UDP transport. Could<br>
you please read the QOTM example?<br>
<div class="im"><br>
— Trustin Lee, <a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
<br>
</div><div><div></div><div class="h5">On Mon, Apr 20, 2009 at 6:31 PM, hezjing <<a href="mailto:hezjing@gmail.com">hezjing@gmail.com</a>> wrote:<br>
> Hi<br>
> I'm trying to create a UDP server with Netty 3.1 BETA2, here is the code<br>
> snippet:<br>
> ChannelFactory factory = new<br>
> OioDatagramChannelFactory(Executors.newCachedThreadPool());<br>
> ServerBootstrap bootstrap = new ServerBootstrap(factory);<br>
> ChannelPipeline pipeline = bootstrap.getPipeline();<br>
> pipeline.addLast("logger", new LoggingHandler(true));<br>
> ...<br>
> Channel channel = bootstrap.bind(new InetSocketAddress(listenPort));<br>
><br>
> When run, it throws the following exception:<br>
> Exception in thread "main" java.lang.IllegalArgumentException: factory must<br>
> be a ServerChannelFactory:<br>
> class org.jboss.netty.channel.socket.oio.OioDatagramChannelFactory<br>
> at<br>
> org.jboss.netty.bootstrap.ServerBootstrap.setFactory(ServerBootstrap.java:183)<br>
> at org.jboss.netty.bootstrap.Bootstrap.<init>(Bootstrap.java:73)<br>
> at<br>
> org.jboss.netty.bootstrap.ServerBootstrap.<init>(ServerBootstrap.java:174)<br>
><br>
> Do you have any idea of what could be the reason?<br>
><br>
> On Wed, Apr 8, 2009 at 4:50 PM, Trustin Lee <<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>> wrote:<br>
>><br>
>> On Wed, Apr 8, 2009 at 5:49 PM, Trustin Lee <<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>> wrote:<br>
>> > On Sat, Apr 4, 2009 at 5:06 PM, hezjing <<a href="mailto:hezjing@gmail.com">hezjing@gmail.com</a>> wrote:<br>
>> >> Hi<br>
>> >> The Javadoc explains that OioDatagramChannelFactory is to create<br>
>> >> a blocking<br>
>> >> I/O based UDP client.<br>
>> >><br>
>> >> What should we use to create a UDP server?<br>
>> ><br>
>> > Actually, you can create a UDP client using OioDatagramChannelFactory.<br>
>> > It was a documentation mistake. Please refer to the QOTM server<br>
>> > example.<br>
>><br>
>> Oops. Actually, you can create both UDP client and server using<br>
>> OioDatagramChannelFactory. It was a documentation mistake. Please<br>
>> refer to the QOTM server example.<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>
><br>
><br>
><br>
> --<br>
><br>
> Hez<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>
><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><br>Hez<br>
</div>