Hi Julien,

After writing the last email and doing a little more research, I guess the thing to do to make your ReconnectionFilter as flexible as possible, would be to allow each of the IoConnector.connect() methods to work with this class. As you can see in the MINA JavaDocs: http://directory.apache.org/subprojects/network/apidocs/org/apache/mina/common/IoConnector.html there are four different versions of connect() and the filter currently only supports one of them.

The easiest way that I can see to accomplish this is to provide multiple constructors for the ReconnectionFilter class that account for each of these connection methods.  I've currently added my own with the single SocketAddress, but for a truly flexible filter I guess it would have to support the others as well.

Anyway, I know this is a work in progress, but I just thought that I should mention it, even though it's super obvious.

Thanks again for letting me know where to find this class, and for creating it in the first place.


On 12/27/05, Chris Allen <mrchrisallen@gmail.com> wrote:
Hi Julien,

I'm looking at your filter and have one question about how to use it.  In the constructor you have two SocketAddresses.  One is local and the other is not.  Can you explain what the difference is between the two? 

public ReconnectionFilter(int delay, IoConnector connector, IoHandler handler, SocketAddress address,
            SocketAddress localAddress)

Also, if I'm creating my initial connection with something like this, I only have one SocketAddress (in this case an instance of InetSocketAddress):

ConnectFuture future = connector.connect(new InetSocketAddress(
                bridgeAccountDAO.getJabberServerHostName(), bridgeAccountDAO
                        .getJabberServerPort()), (IoHandler) sessionHandler);

In my case, what would I use for the two SocketAddresses in the ReconnectFilter?

I suppose I can modify your code to only use one SocketConnection as I'm doing (ConnectFuture future = connector.connect(address,  handler);), but I really would like to understand what you are doing before I go ahead and do that.

Thanks for any help you can provide.


On 12/27/05, Chris Allen < mrchrisallen@gmail.com> wrote:
Thanks Julien,

I'm checking it out now.


On 12/27/05, Julien Vermillard < jvermillard@archean.fr> wrote:
It's here

Le mardi 27 décembre 2005 à 11:12 -0500, Chris Allen a écrit :
> Niklas wrote:
> >We have plans to implement a ReconnectFilter for MINA. There is a
> patch
> >in JIRA but it hasn't been applied yet. It may be used to
> automatically
> >reconnect a session which has been closed.
> Any idea when this might be completed?  Did you guys start this at
> all, and if so, is there someplace I can find the source of it?
> Thanks,
> Chris