Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 73473 invoked from network); 1 Feb 2006 14:42:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Feb 2006 14:42:36 -0000 Received: (qmail 90668 invoked by uid 500); 1 Feb 2006 14:42:35 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 90559 invoked by uid 500); 1 Feb 2006 14:42:34 -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 90536 invoked by uid 99); 1 Feb 2006 14:42:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 06:42:33 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=HTML_MESSAGE,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of trustin@gmail.com designates 66.249.92.195 as permitted sender) Received: from [66.249.92.195] (HELO uproxy.gmail.com) (66.249.92.195) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 06:42:33 -0800 Received: by uproxy.gmail.com with SMTP id h2so344284ugf for ; Wed, 01 Feb 2006 06:42:10 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=o+3UgL1ZDB9g0LrHUKJKpA0GCDNHPIpcTZc6dxVJ59K+r9SwNolrMWGqwqijMBR9/rkgD3wxIJlFbXNTvYBCtd8AoJi9m/1pN4gweOM53xmaAh1e2Vqo9nFLQreOL1b3HqFX7EVYoV5jmGFOSjAdXVxyZewMdilxg+dLtMWEdro= Received: by 10.48.255.14 with SMTP id c14mr1459237nfi; Wed, 01 Feb 2006 06:42:10 -0800 (PST) Received: by 10.49.19.19 with HTTP; Wed, 1 Feb 2006 06:42:10 -0800 (PST) Message-ID: <768dcb2e0602010642t4e4d1d94i@mail.gmail.com> Date: Wed, 1 Feb 2006 23:42:10 +0900 From: Trustin Lee To: Apache Directory Developers List Subject: Re: [mina] Can you use the same SessionHandler multiple times?? In-Reply-To: <20060201035435.87687.qmail@web80509.mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_24871_6095766.1138804930479" References: <20060201035435.87687.qmail@web80509.mail.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_24871_6095766.1138804930479 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Samuel, 2006/2/1, Samuel Doyle : > > If I'm opening up multiple persistent connections to > say two hosts can I use the same session handler > multiple times or do I need to create a new instance. > For example: Do I need to keep doing > sessionHandler =3D new MYSessionHandler( ); > within the loop or just doing it once outside is fine? It depends on your implementation. If you store any stateful information a= s an instance member, you should do it inside the loop. Otherwise, it's OK t= o do it only once. In most cases, once is sufficient. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ PGP Key ID: 0x854B996C ------=_Part_24871_6095766.1138804930479 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Samuel,

2006/2/1, Samuel Doyle &= lt;sdoyle_2@yahoo.com>:=
If I'm opening up multiple persistent connections to
say two hosts can I= use the same session handler
multiple times or do I need to create a ne= w instance.
For example:

<snip/>

Do I need to = keep doing
   sessionHandler =3D new MYSessionHandler( );
w= ithin the loop or just doing it once outside is fine?

It depends on your implementation.  If you store= any stateful information as an instance member, you should do it inside th= e loop.  Otherwise, it's OK to do it only once.  In most cases, o= nce is sufficient.

HTH,
Trustin
--
what we call human nature is actu= ally human habit
--
http://gleamyn= ode.net/
PGP Key ID: 0x854B996C ------=_Part_24871_6095766.1138804930479--