Can netty bind to multiple ports?

이희승 (Trustin Lee) trustin at gmail.com
Sun Sep 6 23:33:49 EDT 2009


As other folks mentioned, it is definitely possible, in a different way
than MINA.

Bootstrap and its subtypes are just helpers, which means they are
utility classes that can be used to configure a server or a client and
throw away.  All internal resources related with running your
application is managed by ChannelFactory you've specified in the
Bootstrap constructor.

Therefore, you call ServerBootstrap.bind() or ClientBootstrap.connect()
as many times as you want, and you can even create a new
ServerBootstrap or ClientBootstrap for each bind() or connect() with
different configurations.  The same applies to ConnectionlessBootstrap.

HTH,
Trustin

On Sat, 5 Sep 2009 13:11:03 +0900 (KST)
woodw <woodw82 at gmail.com> wrote:
> 
> I need to implement something similar to what you are planning, but
> using TCP sockets. I would like to specify a separate handler for
> each port which the Channel binds to. I know Mina allows IOAcceptor
> to bind to multiple ports with a protocol handler for each port.
> 
> Is it possible to implement this in Netty. Appreciate any help I can
> get.
> 
> 
> 
> falconair wrote:
> > 
> > I need to listen to stock market data, published as UDP on a number
> > of ports.  I need to parse these messages and publish them to their
> > respective jms topics.
> > 
> > How can I listen to multiple ports?   bind equivalent function can
> > take a set of internet addresses, I didn't see anything like that
> > for Netty.  Did I miss something?
> > 
> > Thanks
> > 
> 



-- 
Trustin Lee, http://gleamynode.net/


More information about the netty-users mailing list