Hi Barry,

2005/6/10, Barry Kaplan <[EMAIL PROTECTED]>:
But I can't figure out one thing. With netty, quickfixj would save off its netty Session instances, and on a timer would check if they have dropped their connection. If so it would invoke Session.start().

Is there any corresponding capability in mina? I'm using the ProtocolConnector, but it does not seem to retain the socket address after the invocation to connect. (Where netty Session did retain this information.) Am I going to have to create a little class to hold onto the socket address for reconnection?
 
You're right.  I removed Session.start() method.  I added IoConnector instead.  Here is the example code:
 
public void sessionClosed( ProtocolSession session ) throws Exception
{
    // Wait for five seconds before reconnecting; you'll have to perform reconnection in other
    // thread actually.  I just slept here for brevity.
    Thread.sleep( 5000 ); 
 
    // Reconnect.
    connector.connect( session.getRemoteAddress(), this );
}
 
Possibly you'd better to extract this code to a method like 'reconnect()' so that it can reusable in more than one place.
 
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Reply via email to