http://issues.apache.org/jira/browse/DIRMINA-120
I think this is the most convenient and elegant way to handle individual I/O requests. WDYT?
Trustin
2005/11/11, Trustin Lee <[EMAIL PROTECTED]>:
What do you think about just using exceptionCaught handler? I think you can use 'instanceof ConnectException'. Let me know if you like it.
Trustin2005/11/11, Niklas Therning < [EMAIL PROTECTED]>: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/
--
what we call human nature is actually human habit
--
http://gleamynode.net/
