newbie - howto properly handle connect failures

lists at joerg-buchberger.de lists at joerg-buchberger.de
Thu Apr 29 05:19:11 EDT 2010


Anyonghaseyo Trustin.
 
It works now - thanks!
I've some followup questions, though:
 
If the connectTimeoutMillis option is not used - is that the same as
ChannelConfig.setConnectTimeoutMillis(0), which disables(?) timeout?
 
Why is it, that without the connectTimeoutMillis option, calls to
future.awaitUninterruptibly() return almost immediately when host does not
exist?


Why would I want to use awaitUninterruptibly(long timeoutMillis),
when I can (or should?!) set the connectTimeoutMillis option on the bootstrap
anyway?


Is there a summary of optional and required bootstrap options? (In my case,
should I probaby look at ChannelConfig/SocketChannelConfig or is there
additionally something more comprehensive?)




Cheers and kamsahamnida for this framework.
Joerg






p.s. (and off-topic) ... about the korean characters in your mail address
signature ... how would they read in english pronunciation? I Hyeu Seung?

 

"Trustin Lee (이희승)" <trustin at gmail.com> hat am 28. April 2010 um 08:40
geschrieben:

> This is incorrect.  Connect timeout must be specified as a bootstrap option:
>
>     bootstrap.setOption("child.connectTimeoutMillis", 60000);
>
> and you must make sure that the ChannelFuture returned by connect() is
> complete.  Otherwise, the future might return before the connection
> attempt is finished completely.
>
> HTH,
> Trustin
>
> Vijay K Pandey wrote:
> > May be you should not wait Indefinitely on the client connect - have some
> > time parameter - for eg 60 secs or so
> >
> > future.awaitUninterruptibly(60, TimeUnit.SECONDS);
> >
> > if (!future.isSuccess()) {
> >       bootstrap.releaseExternalResources();
> >       throw future.getCause();
> > }
> >
> > I myself starting looking into Netty from yesterday - so I might be totally
> > wrong :)
> >
> > Cheers
> > Vijay
>
> --
> what we call human nature in actuality is human habit
> http://gleamynode.net/
>
>



More information about the netty-users mailing list