On 9/11/07, HansJ <[EMAIL PROTECTED]> wrote: > > Hello > > Using the MINA NetCat as the example. > I'm using MINA 1.1.2. > > I'm struggling to understand how MINA tcp clients detects connects errors, > i.e. when an initial tcp connection cannot be made. > > I would like to separate into different scenarios: > > 1. Endpoint specified by hostname, port#. Problem: hostname cannot be > resolved. > > I know the answer myself to this one: It will result in an OS error that > will be thrown as an exception. > > 2. Endpoint specified by ip, port#. Problem: ip address does not exist on > network. >
I confirmed these two cases for fine. > 3. Endpoint specified by hostname or ip, port#. Problem: host reachable, but > no listener on that port. > > I've tested this scenario. Nothing happens, no callback, nothing, the NetCat > application just ends after approximately 1 minute. ConnectTimeout is set to > 15 secs. It's just because IoHandler is not invoked at all when the connection attempt fails. IoConnector.connect() returns a ConnectFuture, so you can add an handler to it, or wait for the future by calling join() and call getSession() to get the connected session. To be more concise, timeout is processed correctly in MINA. > 4. Endpoint specified by hostname or ip, port#. Problem: host unreachable. This case should work fine. Please let us know if it doesn't work well. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
