how to use Channel.connect()

Trustin Lee tlee at redhat.com
Thu Feb 19 09:16:27 EST 2009


Hi Christian,

On Mon, Feb 16, 2009 at 5:07 PM, Christian Migowski
<chrismfwrd at gmail.com> wrote:
> When I try to use Channel.connect(Socketaddress), I always get a
> ChannelClosedException. There seem to be no open() in the Netty
> Channel, so how can I revive a channel to reconnect it?

If a ClientSocketChannel is disconnected once, it's closed and cannot
be reused.  That's why you are getting a ChannelClosedException.  You
have to create a new Channel.  There's no Channel.open() because all
Channels are open when it's created.

There's a plan to implement a meta-transport that allows reusing a Channel:

  * https://jira.jboss.org/jira/browse/NETTY-70

Any contribution appreciated! :)

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




More information about the netty-users mailing list