Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 61553 invoked from network); 10 Jun 2005 05:37:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Jun 2005 05:37:06 -0000 Received: (qmail 34323 invoked by uid 500); 10 Jun 2005 05:36:56 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 34258 invoked by uid 500); 10 Jun 2005 05:36:56 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 34204 invoked by uid 99); 10 Jun 2005 05:36:55 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_30_40,HTML_MESSAGE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of trustin@gmail.com designates 64.233.184.201 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.201) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Jun 2005 22:36:51 -0700 Received: by wproxy.gmail.com with SMTP id 70so624424wra for ; Thu, 09 Jun 2005 22:36:26 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=j//7J1n7dbGhPHjGaiCtR0K82M25Aq215G2vUefWUKGhL0zeqc6ekzpJqCajl8rPe2nZeAdhg/6TXzJ5lJSwe25Aq6ATA90wcNFN7+cjRZvt88zOOE0WFIogg/XwPcPTZiIImIp1T3iDcMJ40o5MVrwIYdOMwpKSduJZ3qbqrwo= Received: by 10.54.33.53 with SMTP id g53mr775854wrg; Thu, 09 Jun 2005 22:36:26 -0700 (PDT) Received: by 10.54.72.4 with HTTP; Thu, 9 Jun 2005 22:36:26 -0700 (PDT) Message-ID: <768dcb2e05060922364ef407fd@mail.gmail.com> Date: Fri, 10 Jun 2005 14:36:26 +0900 From: Trustin Lee Reply-To: Trustin Lee To: Apache Directory Developers List Subject: Re: Converting from netty2 question In-Reply-To: <42A88F20.3080803@memelet.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2650_23029574.1118381786445" References: <42A88F20.3080803@memelet.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2650_23029574.1118381786445 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Barry, 2005/6/10, Barry Kaplan :=20 >=20 > But I can't figure out one thing. With netty, quickfixj would save off it= s=20 > netty Session instances, and on a timer would check if they have dropped= =20 > their connection. If so it would invoke Session.start(). >=20 > Is there any corresponding capability in mina? I'm using the=20 > ProtocolConnector, but it does not seem to retain the socket address afte= r=20 > the invocation to connect. (Where netty Session did retain this=20 > information.) Am I going to have to create a little class to hold onto th= e=20 > socket address for reconnection? You're right. I removed Session.start() method. I added IoConnector=20 instead. Here is the example code: public void sessionClosed( ProtocolSession session ) throws Exception { // Wait for five seconds before reconnecting; you'll have to perform=20 reconnection in other // thread actually. I just slept here for brevity. Thread.sleep( 5000 );=20 // Reconnect. connector.connect( session.getRemoteAddress(), this ); } Possibly you'd better to extract this code to a method like 'reconnect()'= =20 so that it can reusable in more than one place. Trustin --=20 what we call human nature is actually human habit -- http://gleamynode.net/ ------=_Part_2650_23029574.1118381786445 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Barry,

2005/6/10, Barry Kaplan <groups1@memelet.com>:
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 i= nvoke=20 Session.start().

Is there any corresponding capability in mina? I'm = using the ProtocolConnector, but it does not seem to retain the socket addr= ess after the invocation to connect. (Where netty Session did retain this i= nformation.) Am I going to have to create a little class to hold onto the s= ocket address for reconnection?
 
You're right.  I removed Session.start() method.  I added Io= Connector instead.  Here is the example code:
 
public void sessionClosed( ProtocolSession session ) throws Exception<= /div>
{
    // Wait for five seconds before reconnecting; you'l= l have to perform reconnection in other
    // thread actually.  I just slept here fo= r 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/
=
------=_Part_2650_23029574.1118381786445--