directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [mina] Detecting connect failure without waiting for ConnectFuture
Date Fri, 11 Nov 2005 08:38:42 GMT
What do you think about just using exceptionCaught handler? I think you can
use 'instanceof ConnectException'. Let me know if you like it.

Trustin

2005/11/11, Niklas Therning <niklas@trillian.se>:
>
> Since I badly needed to be able to detected connect failures without
> having to wait for a ConnectFuture I added support for it. See the
> attached patch. Basically what I've done is to add an extra callback to
> IoHandler:
>
> void connectFailed( Throwable cause, Object mark ) throws Exception;
>
> Then there is an extra connect-method in IoConnector:
>
> ConnectFuture connect( SocketAddress address, SocketAddress localAddress,
> IoHandler handler, Object mark ) throws
> IOException;
>
> When connect fails for any of the IoConnector implementations they will
> notify the IoHandler specified in the call to connect() and pass along
> the mark Object. That's it.
>
> NOTE: I had to move the call to sessionCreated in
> DatagramConnectorDelegate.regsiterNew() down a bit to make it less
> likely that sessionCreated() is called even if connect fails.
>
> Is this something that could be considered for inclusion in Mina?
>
> /Niklas
>
> Niklas Therning wrote:
>
> >Forgot the [mina] prefix. Sorry.
> >
> >Hi,
> >
> >Is there any way I can detect if a connect operation fails without
> >having to join or poll the ConnectFuture returned by connect()?
> >
> >/Niklas
> >
> >
> >
> >
>
>
>
>


--
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message