mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zigor Salvador <ZigorSalva...@tourgune.org>
Subject Handling disconnections...
Date Tue, 22 Jun 2010 16:28:42 GMT
Hi all,

I'm developing a simple text protocol using TCP connectors/acceptors.

My application needs to send a periodic message to two remote endpoints at addressA and addressB.
When the acceptors in addressA and addressB are running, the communication goes as expected
(two NioProcessors are automatically created by MINA to handle the two session.write() events).
However, when one of the remote acceptors disconnects, none of the messages gets delivered.
Things go like this:

I have a send(message) method implemented in the class wrapping the connector object which:

- Checks to see if the corresponding session is connected, based on the destination address
of the message.
- Performs a session.write with the connector if the corresponding session is active and connected.
- Tries to reconnect if that's not the case (ConnectFuture with awaitUninterruptibly()).

My simplified execution loop goes:

while (true)
	send(messageA);       // message objects encapsulate destination addresses...

But when the acceptor in addressA (destination of messageA) is disconnected, the second send
call of each loop is never executed.

Is this related to the ConnectFuture somehow stopping the execution flow? Is there a way to
perform a synchronous connetion attempt?

Thank you.


Ps: a pointer to any related documentation would be GREATLY appreciated too.

View raw message