Enabling a client timeout
Christian Migowski
chrismfwrd at gmail.com
Thu Aug 6 02:34:05 EDT 2009
On Thu, Aug 6, 2009 at 1:49 AM, Michael
Elsdörfer<michael at elsdoerfer.info> wrote:
> Well, I would expect the OS to expose those options to applications. And
> in fact, using the normal Java socket API the timeout does work for me:
>
> Socket sock = new Socket();
> sock.connect(new InetSocketAddress("host", 8765), 500);
>
> This times out after 500 msecs, while taking 20 secs if no timeout is
> specified.
>
> Are you saying there is now way to achieve this behavior in netty?
no. specifying the connectTimeoutMillis option like the original
poster did will ultimatively do the same in the Netty internals as
your code (if you are using the "OIO" transport).
I wonder if it is a bug or intended that this option isn't used in the
NIO transport - I am not a Netty developer, you know.
christian
More information about the netty-users
mailing list