From mina-dev-returnlauren93@example.org Sat Jul 01 10:17:35 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 74924 invoked from network); 1 Jul 2006 10:17:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jul 2006 10:17:35 -0000 Received: (qmail 16052 invoked by uid 500); 1 Jul 2006 10:17:34 -0000 Delivered-To: lauren93@example.org Received: (qmail 16037 invoked by uid 500); 1 Jul 2006 10:17:34 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 16024 invoked by uid 99); 1 Jul 2006 10:17:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jul 2006 03:17:34 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO linux.easyhost.be) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jul 2006 03:17:33 -0700 Received: (qmail 24776 invoked from network); 1 Jul 2006 12:17:07 +0200 Received: from localhost (83.161.120.155) by localhost with SMTP; 1 Jul 2006 12:17:07 +0200 Received: from 147-132.241.81.adsl.skynet.be (147-132.241.81.adsl.skynet.be [83.161.120.155]) by webmail.daune-consult.com (Horde MIME library) with HTTP; Sat, 1 Jul 2006 12:17:07 +0200 Message-ID: <lauren93@example.org> Date: Sat, 1 Jul 2006 12:17:07 +0200 From: lauren93@example.org To: lauren93@example.org Subject: Re: Sendind message in filterClose References: <lauren93@example.org> <lauren93@example.org> In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.1) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Quoting peter royal <lauren93@example.org>: > On Jun 30, 2006, at 1:36 PM, lauren93@example.org wrote: >> I have implemented a filter, and in filterClose() I send a message >> without calling nextFilter.filterClose(). >> >> The message is never sent. I added a Callback to WriteFuture, and >> isWritten returns false. >> >> Is it forbidden to send messages in filterClose? > > Off the top of my head, you may be getting the filterClose event > because the other end closed the connection, in which case, you can't > write them anything else. > > I would think that what you're trying to do would work if the close > was initiated by IoSession.close() on the side that you're trying to > do this behavior. > > -pete > It should not be the client that closes the connection. I'll keep investigating, but if you have other ideas... J-F From mina-dev-returnlauren93@example.org Sat Jul 01 21:44:48 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 75031 invoked from network); 1 Jul 2006 21:44:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jul 2006 21:44:48 -0000 Received: (qmail 56686 invoked by uid 500); 1 Jul 2006 21:44:47 -0000 Delivered-To: lauren93@example.org Received: (qmail 56659 invoked by uid 500); 1 Jul 2006 21:44:47 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 56650 invoked by uid 99); 1 Jul 2006 21:44:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jul 2006 14:44:47 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ug-out-1314.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jul 2006 14:44:46 -0700 Received: by ug-out-1314.google.com with SMTP id a2so1145477ugf for <lauren93@example.org>; Sat, 01 Jul 2006 14:44:24 -0700 (PDT) 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:content-transfer-encoding:content-disposition:references; b=aTjnxvH3iFgw//TpPEegvC5VdGd0gtntjViAmW0r6R33I7uXuNZ0brMuqmlp7k7zJAxIxznTVkTWcGwXYH/1RELYDzkaoEjeBMyU+M0d86w8BhwCzLdjLWW/Cp6dFWpbBT9TGOBtJI0o7rdWq8gItGRyBqA6U6ADSy11N5tqH+k= Received: by 83.161.120.155 with SMTP id b13mr4328796ugj; Sat, 01 Jul 2006 14:44:24 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sat, 1 Jul 2006 14:44:24 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Sat, 1 Jul 2006 16:44:24 -0500 From: "John Preston" <lauren93@example.org> To: lauren93@example.org Subject: Re: HttpProtocolHandler and IOSessions In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Ok, well I couldn't figure out what I was doing wrong to keep the server socket open between HTTP requests using the example HTTP code so if anybody is interested, I've implemented a HTTP protocol coder and decoder modeled after the sumup example. It seems to work for simple GET and POST requests, and the keep-alive stuff without any problem. If anybody wants the code its available but I dont know where to put it. John On 6/30/06, John Preston <lauren93@example.org> wrote: > > > I've got the example working fine but I can't see where its calling > > > closeSession before each new message, and I've set all the timeouts, > > > etc. > > > > the client is probably closing the connection after it has read all > > the data. > I'm using a browser to test the server connection. I thought that if I > supplied the required headers in the response sent back to the browser > (Connection: Keep-Alive, keep-Alive: 300), that it would keep the > connection open and the next request from the browser would re-use the > connection. Is this not so?. > > john > > > -pete > > > > > > -- > > lauren93@example.org - http://fotap.org/~osi > > > > > > > > > > > > > From mina-dev-returnlauren93@example.org Sun Jul 02 07:19:14 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 39168 invoked from network); 2 Jul 2006 07:19:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jul 2006 07:19:13 -0000 Received: (qmail 81097 invoked by uid 500); 2 Jul 2006 07:19:13 -0000 Delivered-To: lauren93@example.org Received: (qmail 81079 invoked by uid 500); 2 Jul 2006 07:19:13 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 81069 invoked by uid 99); 2 Jul 2006 07:19:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jul 2006 00:19:12 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jul 2006 00:19:12 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id A59857141FA for <lauren93@example.org>; Sun, 2 Jul 2006 07:17:30 +0000 (GMT) Message-ID: <26481883.1151824650675.JavaMail.jira@brutus> Date: Sun, 2 Jul 2006 07:17:30 +0000 (GMT+00:00) From: "Ralf Hauser (JIRA)" <lauren93@example.org> To: lauren93@example.org Subject: [jira] Commented: (DIRMINA-114) All session log messages should be logged via SessionLog MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIRMINA-114?page=comments#action_12418825 ] Ralf Hauser commented on DIRMINA-114: ------------------------------------- see DIRSERVER-660 for security issues with this approach - there should be a way to adapt the log level depending on the message content/type received or at least mask out sensitive information such as Simple authentication : '1****** ' > All session log messages should be logged via SessionLog > -------------------------------------------------------- > > Key: DIRMINA-114 > URL: http://issues.apache.org/jira/browse/DIRMINA-114 > Project: Directory MINA > Type: Improvement > Versions: 0.8 > Reporter: Trustin Lee > Assignee: Trustin Lee > Priority: Minor > Fix For: 0.9 > > Some users don't want to use another logging framework (or facade) like SLF4J. At least we could make it easy for them to modify MINA to get rid of SLF4J dependency. To do so, all session log messages should be forwarded to org.apache.mina.util.SessionLog so that they can simply override that class. > Additionally the users will have to replace DefaultExceptionMonitor which logs messages which is not for a specific session. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From mina-dev-returnlauren93@example.org Sun Jul 02 15:36:11 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 59931 invoked from network); 2 Jul 2006 15:36:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jul 2006 15:36:11 -0000 Received: (qmail 65399 invoked by uid 500); 2 Jul 2006 15:36:10 -0000 Delivered-To: lauren93@example.org Received: (qmail 65005 invoked by uid 500); 2 Jul 2006 15:36:09 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 64984 invoked by uid 99); 2 Jul 2006 15:36:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jul 2006 08:36:09 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_10_20,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jul 2006 08:36:08 -0700 Received: by py-out-1112.google.com with SMTP id s49so448362pyc for <lauren93@example.org>; Sun, 02 Jul 2006 08:35:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=qoALR/iUXSUYlmLhYS+jOewTPR8lHDXcgqST/VB+OeeePp75cWRU0DK/+Ram5iGdPrRyjJDcFNAjT2GPs6YSJJ9E5o5jyH1i5gJogulgGSDDCfi1XJ4mQnhkHBtazH2I76MST71OVY0gwuVdxa+xdZO72IBPiVL/obroSCjmzoI= Received: by 83.161.120.155 with SMTP id d9mr220527pym; Sun, 02 Jul 2006 08:35:47 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 2 Jul 2006 08:35:47 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 00:35:47 +0900 From: "Trustin Lee" <lauren93@example.org> To: "Apache Directory Developers List" <lauren93@example.org>, lauren93@example.org Subject: [OT] My recent situation MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_47811_22964310.1151854547431" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_47811_22964310.1151854547431 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I was missing in action recently due to some problems I had to deal with... * The company I work for has been acquired by other company. I packed my stuff and spent most of my time to find a better team to work with in the new company. This sitution should be resolved soon hopefully. * My dog, who is 16 years old and has been with me for her entire life, is ill. She didn't eat anything but water since last week. It makes me really sad that she is dying. * I might be still busy looking for a room near the new company next week. It takes more than 2 hours to get there for now. In spite of all these situations, I will try to catch up all messages in my inbox soon and give answers to your questions. Thanks, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_47811_22964310.1151854547431-- From mina-dev-returnlauren93@example.org Mon Jul 03 07:03:38 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 69092 invoked from network); 3 Jul 2006 07:03:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 07:03:37 -0000 Received: (qmail 69732 invoked by uid 500); 3 Jul 2006 07:03:37 -0000 Delivered-To: lauren93@example.org Received: (qmail 69395 invoked by uid 500); 3 Jul 2006 07:03:36 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 69386 invoked by uid 99); 3 Jul 2006 07:03:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 00:03:35 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO linux.easyhost.be) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 00:03:34 -0700 Received: (qmail 17014 invoked from network); 3 Jul 2006 09:03:08 +0200 Received: from localhost (83.161.120.155) by localhost with SMTP; 3 Jul 2006 09:03:08 +0200 Received: from 83.161.120.155 ([83.161.120.155]) by webmail.daune-consult.com (Horde MIME library) with HTTP; Mon, 3 Jul 2006 09:03:08 +0200 Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 09:03:08 +0200 From: lauren93@example.org To: lauren93@example.org Subject: Re: Sendind message in filterClose References: <lauren93@example.org> <lauren93@example.org> In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.1) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Quoting peter royal <lauren93@example.org>: > On Jun 30, 2006, at 1:36 PM, lauren93@example.org wrote: >> I have implemented a filter, and in filterClose() I send a message >> without calling nextFilter.filterClose(). >> >> The message is never sent. I added a Callback to WriteFuture, and >> isWritten returns false. >> >> Is it forbidden to send messages in filterClose? > > Off the top of my head, you may be getting the filterClose event > because the other end closed the connection, in which case, you can't > write them anything else. > > I would think that what you're trying to do would work if the close > was initiated by IoSession.close() on the side that you're trying to > do this behavior. > > -pete I am now sure that it is not the client that closes the connection. Is it possible to determine why message is not sent? WriteFuture only has a boolean indicating success or failure. How can I know the failure reason? J-F From mina-dev-returnlauren93@example.org Mon Jul 03 07:25:30 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 78718 invoked from network); 3 Jul 2006 07:25:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 07:25:30 -0000 Received: (qmail 93970 invoked by uid 500); 3 Jul 2006 07:25:29 -0000 Delivered-To: lauren93@example.org Received: (qmail 93945 invoked by uid 500); 3 Jul 2006 07:25:29 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 93936 invoked by uid 99); 3 Jul 2006 07:25:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 00:25:29 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO linux.easyhost.be) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 00:25:28 -0700 Received: (qmail 18944 invoked from network); 3 Jul 2006 09:25:04 +0200 Received: from localhost (83.161.120.155) by localhost with SMTP; 3 Jul 2006 09:25:04 +0200 Received: from 83.161.120.155 ([83.161.120.155]) by webmail.daune-consult.com (Horde MIME library) with HTTP; Mon, 3 Jul 2006 09:25:04 +0200 Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 09:25:04 +0200 From: lauren93@example.org To: lauren93@example.org Subject: Re: Sendind message in filterClose References: <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.1) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Quoting lauren93@example.org: > Quoting peter royal <lauren93@example.org>: > >> On Jun 30, 2006, at 1:36 PM, lauren93@example.org wrote: >>> I have implemented a filter, and in filterClose() I send a message =20 >>> without calling nextFilter.filterClose(). >>> >>> The message is never sent. I added a Callback to WriteFuture, and =20 >>> isWritten returns false. >>> >>> Is it forbidden to send messages in filterClose? >> >> Off the top of my head, you may be getting the filterClose event >> because the other end closed the connection, in which case, you can't >> write them anything else. >> >> I would think that what you're trying to do would work if the close >> was initiated by IoSession.close() on the side that you're trying to >> do this behavior. >> >> -pete > > I am now sure that it is not the client that closes the connection. > > Is it possible to determine why message is not sent? WriteFuture only > has a boolean indicating success or failure. How can I know the > failure reason? > > J-F OK. Once close() is called on BaseIoSession, its state switches to 'closing'= . In this state, calling write() leads to calling =20 WriteFuture.newNotWrittenFuture() which returns a 'fake' WriteFuture =20 without enqueuing the request. So, you cannot write message to a closing session. J-F From mina-dev-returnlauren93@example.org Mon Jul 03 08:00:58 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 85176 invoked from network); 3 Jul 2006 08:00:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 08:00:58 -0000 Received: (qmail 19369 invoked by uid 500); 3 Jul 2006 08:00:57 -0000 Delivered-To: lauren93@example.org Received: (qmail 19346 invoked by uid 500); 3 Jul 2006 08:00:57 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 19334 invoked by uid 99); 3 Jul 2006 08:00:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:00:57 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:00:56 -0700 Received: by py-out-1112.google.com with SMTP id s49so599761pyc for <lauren93@example.org>; Mon, 03 Jul 2006 01:00:35 -0700 (PDT) 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=W1F5BsGm4r56NugVzINOMBzkLE3khHUhlsoCp35UP5Z/4d62NPTrQWwnba5HjYGw0QY7lFb7tmDdWGBWbdhVBBfAVeiwSfJORKsb+fSPizlLWEN0l5ojPt3myKCxbVaeubzBhuzJ8syLE6vKNjN04vhNrfAAwy98Gj896FOQWLw= Received: by 83.161.120.155 with SMTP id d9mr706472pym; Mon, 03 Jul 2006 01:00:35 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 01:00:35 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 17:00:35 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: Re: Sendind message in filterClose In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_54904_10540146.1151913635408" References: <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_54904_10540146.1151913635408 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/3/06, lauren93@example.org <lauren93@example.org> wrote: > > Quoting lauren93@example.org: > > > Quoting peter royal <lauren93@example.org>: > > > >> On Jun 30, 2006, at 1:36 PM, lauren93@example.org wrote: > >>> I have implemented a filter, and in filterClose() I send a message > >>> without calling nextFilter.filterClose(). > >>> > >>> The message is never sent. I added a Callback to WriteFuture, and > >>> isWritten returns false. > >>> > >>> Is it forbidden to send messages in filterClose? > >> > >> Off the top of my head, you may be getting the filterClose event > >> because the other end closed the connection, in which case, you can't > >> write them anything else. > >> > >> I would think that what you're trying to do would work if the close > >> was initiated by IoSession.close() on the side that you're trying to > >> do this behavior. > >> > >> -pete > > > > I am now sure that it is not the client that closes the connection. > > > > Is it possible to determine why message is not sent? WriteFuture only > > has a boolean indicating success or failure. How can I know the > > failure reason? > > > > J-F > > > OK. Once close() is called on BaseIoSession, its state switches to > 'closing'. > > In this state, calling write() leads to calling > WriteFuture.newNotWrittenFuture() which returns a 'fake' WriteFuture > without enqueuing the request. > > So, you cannot write message to a closing session. I thought we can write a message in filterClose() by doing like this: void filterClose(...) { WriteFuture future = next.filterWrite(...); future.setCallback(new IoFuture.Callback() { public void operationComplete(...) { future.getSession().close(); } }); } If this doesn't work, this is a bug. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_54904_10540146.1151913635408-- From mina-dev-returnlauren93@example.org Mon Jul 03 08:08:40 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 87075 invoked from network); 3 Jul 2006 08:08:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 08:08:39 -0000 Received: (qmail 31238 invoked by uid 500); 3 Jul 2006 08:08:37 -0000 Delivered-To: lauren93@example.org Received: (qmail 31189 invoked by uid 500); 3 Jul 2006 08:08:36 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 31151 invoked by uid 99); 3 Jul 2006 08:08:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:08:36 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:08:34 -0700 Received: by py-out-1112.google.com with SMTP id s49so601435pyc for <lauren93@example.org>; Mon, 03 Jul 2006 01:08:14 -0700 (PDT) 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=SavHB5RCTplbW6JzkW7o++UFYdCImC+RsT8O5hGrr2jdIWis8luR9Da0XgAr8jB3m3NEVGv7WvMdTRSbUdgysBX8EVlFJc005pc+C8FLvJdaxa996W0GDfo2XAhK1tIOYB/xYbcmxzO7vqXUfvjstG03ef6xvq2nFLzI1zrVhZ0= Received: by 83.161.120.155 with SMTP id g19mr1037957pyn; Mon, 03 Jul 2006 01:08:14 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 01:08:14 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 17:08:14 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: Re: Server closes session with low bandwidth clients In-Reply-To: <020801c69909$faee3b70$3be01e55@elabpc> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_54972_5953372.1151914094153" References: <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <lauren93@example.org> <013901c698f3$a06b4fa0$3be01e55@elabpc> <lauren93@example.org> <020801c69909$faee3b70$3be01e55@elabpc> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_54972_5953372.1151914094153 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/26/06, Eugene Labunsky <lauren93@example.org> wrote: > > Hello Trustin, > > >All what I can say is > > that you'd better upgrade to MINA now. Upgrade process is very simple. > > Please refer to the web site. > > I refer web site, but looks like sample for MINA 0.8. I like use last 0.9 > release. Do you have migration sample for 0.9? I can't find in MINA 0.9 > ProtocolProvider Class... Could you advise what I need use? Could you take a look into the Getting Started section of our on-line web site? You can browse the SumUp example which demonstratess the use of a protocol codec. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_54972_5953372.1151914094153-- From mina-dev-returnlauren93@example.org Mon Jul 03 08:31:59 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 95234 invoked from network); 3 Jul 2006 08:31:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 08:31:59 -0000 Received: (qmail 67611 invoked by uid 500); 3 Jul 2006 08:31:59 -0000 Delivered-To: lauren93@example.org Received: (qmail 67458 invoked by uid 500); 3 Jul 2006 08:31:58 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 67449 invoked by uid 99); 3 Jul 2006 08:31:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:31:58 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_10_20,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:31:56 -0700 Received: by py-out-1112.google.com with SMTP id s49so606069pyc for <lauren93@example.org>; Mon, 03 Jul 2006 01:31:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=SFT49YP9D/QvppLE0GWrhWJ6uMH7UGetKOREH0tiv6xwAHG/rOZMjW7SAbGQgkteTKZfQvexm7t0HxalKOODx4GXwfAlVjLBWn1Igr3CRV22dXsI3aF/fM2P+fAyjBrKdNiigDLrIRwebPhA7SiK/mEPQNFWM6GShGD/n25EVG8= Received: by 83.161.120.155 with SMTP id j15mr692009pyl; Mon, 03 Jul 2006 01:31:35 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 01:31:35 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 17:31:35 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: Fixing PooledThreadModel (Was: Re: AnonymousIoService thread) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55288_16594985.1151915495844" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_55288_16594985.1151915495844 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline For now, there's a strong 1-to-1 relationship between PooledThreadModel and thus it causes excessive creation of thread pools. I think at least the PooledThreadModel instances with the same service name should share the same ThreadPoolFilter insstance. What do you think? If you agree with me, there are two choices: * Provide a static factory method for PooledThreadModel instead of constructors. * Retain the constructors, but share the filters using a static map. Thanks in advance for your feedback! Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_55288_16594985.1151915495844-- From mina-dev-returnlauren93@example.org Mon Jul 03 08:41:18 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 97621 invoked from network); 3 Jul 2006 08:41:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 08:41:17 -0000 Received: (qmail 84777 invoked by uid 500); 3 Jul 2006 08:41:15 -0000 Delivered-To: lauren93@example.org Received: (qmail 84621 invoked by uid 500); 3 Jul 2006 08:41:14 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 84605 invoked by uid 99); 3 Jul 2006 08:41:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:41:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:41:13 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 9C95C410391 for <lauren93@example.org>; Mon, 3 Jul 2006 08:39:30 +0000 (GMT) Message-ID: <23606006.1151915970638.JavaMail.jira@brutus> Date: Mon, 3 Jul 2006 08:39:30 +0000 (GMT+00:00) From: "Trustin Lee (JIRA)" <lauren93@example.org> To: lauren93@example.org Subject: [jira] Commented: (DIRMINA-184) Allow ThreadPool used by ThreadPoolFilter to be pluggable In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIRMINA-184?page=comments#action_12418920 ] Trustin Lee commented on DIRMINA-184: ------------------------------------- No objection! Did you already make changes? > Allow ThreadPool used by ThreadPoolFilter to be pluggable > --------------------------------------------------------- > > Key: DIRMINA-184 > URL: http://issues.apache.org/jira/browse/DIRMINA-184 > Project: Directory MINA > Type: Improvement > Reporter: peter royal > Assignee: peter royal > Fix For: 0.9.5 > Attachments: NewThreadPoolFilter.java, pluggable thread pool.diff > > Attached is the start of a patch to allow the ThreadPool that a ThreadPoolFilter uses to be pluggable. Currently depends on Java5, but works as an illustration of thoughts. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From mina-dev-returnlauren93@example.org Mon Jul 03 08:49:21 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 99981 invoked from network); 3 Jul 2006 08:49:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 08:49:21 -0000 Received: (qmail 94642 invoked by uid 500); 3 Jul 2006 08:49:20 -0000 Delivered-To: lauren93@example.org Received: (qmail 94493 invoked by uid 500); 3 Jul 2006 08:49:20 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 94484 invoked by uid 99); 3 Jul 2006 08:49:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:49:20 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 01:49:19 -0700 Received: by py-out-1112.google.com with SMTP id e30so1348653pya for <lauren93@example.org>; Mon, 03 Jul 2006 01:48:58 -0700 (PDT) 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=iZD8KeEHcM9hMSfru6/6kK7tDJoLmBJ6aGg7Iln34a9GGV0B+Xk0jP9xc1D63lCdN0G7+sY64JJR1SUscIr9yNr3CefLmC1zbUKcoXAmJaIamyFRvRJKD4DWEajaGxlha3HB4cNokHiPTUiZKieSeBfoBPSJShH7sI2IudT7AjI= Received: by 83.161.120.155 with SMTP id b14mr2592261pym; Mon, 03 Jul 2006 01:48:58 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 01:48:58 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 17:48:58 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: Re: svn commit: r417502 - /directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ReadThrottleFilter.java In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55612_12307846.1151916538277" References: <lauren93@example.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_55612_12307846.1151916538277 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Peter! Your addition of ReadThrottleFilter looks good for me. It is very creative! :) Here's my comments: * The class name ends with 'Filter', but it's not a filter. Wouldn't there be a better name? This is very close to IoFilterChainBuilder, but it's too long. Any idea? * We have to increate the counter by remaining() instead of capacity() to be more accurate. * Is it impossible to use getTrafficMask() instead of using the session attribute? Was there any reason to do so? That's all. Everything is superb except that. :D Cheers, Trustin On 6/28/06, lauren93@example.org <lauren93@example.org> wrote: > > Author: proyal > Date: Tue Jun 27 09:31:30 2006 > New Revision: 417502 > > URL: http://svn.apache.org/viewvc?rev=417502&view=rev > Log: > DIRMINA-206 - Filter that watches the total amount queue'd for a > connection in the ThreadPoolFilter and will disable reads for a connection > when a configurable (default 1mb) limit is reached. > > Added: > > directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ReadThrottleFilter.java > > Added: > directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ReadThrottleFilter.java > URL: > http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ReadThrottleFilter.java?rev=417502&view=auto > > ============================================================================== > --- > directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ReadThrottleFilter.java > (added) > +++ > directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ReadThrottleFilter.java > Tue Jun 27 09:31:30 2006 > @@ -0,0 +1,192 @@ > +/* > + * @(#) $Id: StreamWriteFilterTest.java 389042 2006-03-27 07:49:41Z > trustin $ > + * > + * Copyright 2004 The Apache Software Foundation > + * > + * Licensed under the Apache License, Version 2.0 (the "License"); > + * you may not use this file except in compliance with the License. > + * You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > implied. > + * See the License for the specific language governing permissions and > + * limitations under the License. > + */ > +package org.apache.mina.filter; > + > +import java.util.Iterator; > +import java.util.List; > + > +import org.apache.mina.common.ByteBuffer; > +import org.apache.mina.common.DefaultIoFilterChainBuilder; > +import org.apache.mina.common.IoFilterAdapter; > +import org.apache.mina.common.IoFilterChain; > +import org.apache.mina.common.IoSession; > +import org.apache.mina.filter.thread.ThreadPoolFilter; > + > +/** > + * This filter will automatically disable reads on an > <code>IoSession</code> once the data batched for that session in > + * the <code>ThreadPoolFilter</code> reaches a defined threshold (the > default is 1mb). It accomplishes this by being in > + * the filter chain before <strong>and</strong> after the > <code>ThreadPoolFilter</code>. It is possible to subvert the > + * behavior of this filter by adding filters immediately after the > <code>ThreadPoolFilter</code> after adding this > + * filter. Thus, it is recommended to add this filter towards the end of > your filter chain construction, if you need to > + * ensure that other filters need to be right after the > <code>ThreadPoolFilter</code>. > + * > + * <p>Usage: > + * > + * <pre><code> > + * DefaultFilterChainBuilder builder = ... > + * ReadThrottleFilter filter = new ReadThrottleFilter(); > + * filter.attach( builder ); > + * </code></pre> > + * > + * or > + * > + * <pre><code> > + * IoFilterChain chain = ... > + * ReadThrottleFilter filter = new ReadThrottleFilter(); > + * filter.attach( chain ); > + * </code></pre> > + * > + * @author The Apache Directory Project (lauren93@example.org) > + * @version $Rev: 406554 $, $Date: 2006-05-15 06:46:02Z $ > + */ > +public class ReadThrottleFilter > +{ > + public static final String COUNTER = ReadThrottleFilter.class.getName() > + ".counter"; > + public static final String SUSPENDED_READS = > ReadThrottleFilter.class.getName() + ".suspendedReads"; > + > + private volatile int maximumConnectionBufferSize = 1024 * 1024; // > 1mb > + > + /** > + * Set the maximum amount of data to buffer in the ThreadPoolFilter > prior to disabling reads. Changing the value > + * will only take effect when new data is received for a connection, > including existing connections. Default value > + * is 1mb > + * > + * @param maximumConnectionBufferSize New buffer size. Must be > 0 > + */ > + public void setMaximumConnectionBufferSize( int > maximumConnectionBufferSize ) > + { > + this.maximumConnectionBufferSize = maximumConnectionBufferSize; > + } > + > + /** > + * Attach this filter to the specified filter chain. It will search > for the ThreadPoolFilter, and attach itself > + * before and after that filter. > + * > + * @param chain <code>IoFilterChain</code> to attach self to. > + */ > + public void attach( IoFilterChain chain ) > + { > + String name = getThreadPoolFilterEntryName( chain.getAll() ); > + > + chain.addBefore( name, getClass().getName() + ".add", new Add() > ); > + chain.addAfter( name, getClass().getName() + ".release", new > Release() ); > + } > + > + /** > + * Attach this filter to the specified builder. It will search for > the ThreadPoolFilter, and attach itself before > + * and after that filter. > + * > + * @param builder <code>DefaultIoFilterChainBuilder</code> to attach > self to. > + */ > + public void attach( DefaultIoFilterChainBuilder builder ) > + { > + String name = getThreadPoolFilterEntryName( builder.getAll() ); > + > + builder.addBefore( name, getClass().getName() + ".add", new Add() > ); > + builder.addAfter( name, getClass().getName() + ".release", new > Release() ); > + } > + > + private String getThreadPoolFilterEntryName( List entries ) > + { > + Iterator i = entries.iterator(); > + > + while( i.hasNext() ) > + { > + IoFilterChain.Entry entry = (IoFilterChain.Entry)i.next(); > + > + if( entry.getFilter().getClass().isAssignableFrom( > ThreadPoolFilter.class ) ) > + { > + return entry.getName(); > + } > + } > + > + throw new IllegalStateException( "Chain does not contain a > ThreadPoolFilter" ); > + } > + > + private void add( IoSession session, int size ) > + { > + synchronized( session ) > + { > + int counter = getCounter( session ) + size; > + > + session.setAttribute( COUNTER, new Integer( counter ) ); > + > + if( counter >= maximumConnectionBufferSize && > session.getTrafficMask().isReadable() ) > + { > + session.suspendRead(); > + session.setAttribute( SUSPENDED_READS ); > + } > + } > + } > + > + private void release( IoSession session, int size ) > + { > + synchronized( session ) > + { > + int counter = Math.max( 0, getCounter( session ) - size ); > + > + session.setAttribute( COUNTER, new Integer( counter ) ); > + > + if( counter < maximumConnectionBufferSize && > isSuspendedReads( session ) ) > + { > + session.resumeRead(); > + } > + > + session.removeAttribute( SUSPENDED_READS ); > + } > + } > + > + private boolean isSuspendedReads( IoSession session ) > + { > + Boolean flag = (Boolean)session.getAttribute( SUSPENDED_READS ); > + > + return null != flag && flag.booleanValue(); > + } > + > + private int getCounter( IoSession session ) > + { > + Integer i = (Integer)session.getAttribute( COUNTER ); > + return null == i ? 0 : i.intValue(); > + } > + > + private class Add extends IoFilterAdapter > + { > + public void messageReceived( NextFilter nextFilter, IoSession > session, Object message ) throws Exception > + { > + if( message instanceof ByteBuffer ) > + { > + add( session, ( (ByteBuffer)message ).capacity() ); > + } > + > + nextFilter.messageReceived( session, message ); > + } > + } > + > + private class Release extends IoFilterAdapter > + { > + public void messageReceived( NextFilter nextFilter, IoSession > session, Object message ) throws Exception > + { > + if( message instanceof ByteBuffer ) > + { > + release( session, ( (ByteBuffer)message ).capacity() ); > + } > + > + nextFilter.messageReceived( session, message ); > + } > + } > +} > > > -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_55612_12307846.1151916538277-- From mina-dev-returnlauren93@example.org Mon Jul 03 09:01:43 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 3883 invoked from network); 3 Jul 2006 09:01:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 09:01:43 -0000 Received: (qmail 11347 invoked by uid 500); 3 Jul 2006 09:01:43 -0000 Delivered-To: lauren93@example.org Received: (qmail 11198 invoked by uid 500); 3 Jul 2006 09:01:42 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 11188 invoked by uid 99); 3 Jul 2006 09:01:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:01:42 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:01:41 -0700 Received: by py-out-1112.google.com with SMTP id e30so1352015pya for <lauren93@example.org>; Mon, 03 Jul 2006 02:01:20 -0700 (PDT) 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=ROPTIDaUTGKk6NTxjZNT88h9gmx1OLokiE7vKkd8ABzG3S+Xqx5oV3kaSUxD2YepgS4RE86gIbwYRxp1VGuJAxESA9+FlWwJOGGclqpZ//uL5MGgaeApxMBwgXDexBzBZtsXCbx7slr3hYFdszNWimLggIjHFLn72eE1cmUHH6Y= Received: by 83.161.120.155 with SMTP id x17mr2603107pyk; Mon, 03 Jul 2006 02:01:20 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 02:01:20 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 18:01:20 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: =?GB2312?B?UmU6INeqt6I6IHByb2JsZW0gb2YgTUlOQSBTZXJ2ZXItU2lkZSBvbiBsaW51eA==?= In-Reply-To: <000001c699b5$afd41540$3900a8c0@Jameshark> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55832_30502195.1151917280566" References: <000001c699b5$afd41540$3900a8c0@Jameshark> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_55832_30502195.1151917280566 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi James, On 6/27/06, James-Usertunnel <lauren93@example.org> wrote: > > But There are something strange. There was a time we built a server on > QuickServer framework, then after running 4 some time we use 'kill' to > stop the server there would be no this situation, there were no > connections > stuck on the port the QuickServer bound This is weird. Could you try to run the server in a debug mode and make sure if setReuseAddress is set properly? Plus, could you set reuse_addr for all individual sessions? For instance: ((SocketSessionConfig) config.getSessionConfig()).setReuseAddress(true); HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_55832_30502195.1151917280566-- From mina-dev-returnlauren93@example.org Mon Jul 03 09:05:00 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 4669 invoked from network); 3 Jul 2006 09:05:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 09:05:00 -0000 Received: (qmail 15896 invoked by uid 500); 3 Jul 2006 09:05:00 -0000 Delivered-To: lauren93@example.org Received: (qmail 15876 invoked by uid 500); 3 Jul 2006 09:05:00 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 15862 invoked by uid 99); 3 Jul 2006 09:05:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:05:00 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:04:59 -0700 Received: by py-out-1112.google.com with SMTP id s49so613397pyc for <lauren93@example.org>; Mon, 03 Jul 2006 02:04:38 -0700 (PDT) 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=GF/GgBQBSdCaRRpwISROwL6W+45mE7ZCEUsoCR8DEVQf1Pf34b5ncBBR20yL1eVq83hK4YRGesLqMfU9ImLWnGId2wJCDOJHMrE7mUVCvSQGWAIrGy2OG4jmWRb9fQNoRAistvZQeb0gslgDpxaSVMz6XcnmmUAl91Lk6us1Izs= Received: by 83.161.120.155 with SMTP id f12mr1034773pym; Mon, 03 Jul 2006 02:04:38 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 02:04:38 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 18:04:38 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: Re: Default buffer size In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55896_33007799.1151917478651" References: <lauren93@example.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_55896_33007799.1151917478651 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/27/06, lauren93@example.org <lauren93@example.org> wrote: > > Hi, > > I wonder if it is guaranteed that 'incoming' buffers have a capacity > of SocketSessionConfig.getReceiveBufferSize(). > > I mean that if I change this value, buffer size will be changed > accordingly. Yes. It is always guarenteed that the buffer MINA allocates is equal to or greater than the socket read buffer size you configured. But the size of the allocated buffer is not always equal to the socket read buffer size due to the sideeffect of the internal buffer pooling mechanism. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_55896_33007799.1151917478651-- From mina-dev-returnlauren93@example.org Mon Jul 03 09:10:37 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 5964 invoked from network); 3 Jul 2006 09:10:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 09:10:37 -0000 Received: (qmail 20797 invoked by uid 500); 3 Jul 2006 09:10:36 -0000 Delivered-To: lauren93@example.org Received: (qmail 20785 invoked by uid 500); 3 Jul 2006 09:10:36 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 20775 invoked by uid 99); 3 Jul 2006 09:10:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:10:36 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO linux.easyhost.be) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:10:34 -0700 Received: (qmail 27930 invoked from network); 3 Jul 2006 11:10:09 +0200 Received: from localhost (83.161.120.155) by localhost with SMTP; 3 Jul 2006 11:10:09 +0200 Received: from 83.161.120.155 ([83.161.120.155]) by webmail.daune-consult.com (Horde MIME library) with HTTP; Mon, 3 Jul 2006 11:10:09 +0200 Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 11:10:09 +0200 From: lauren93@example.org To: lauren93@example.org Subject: Re: Sendind message in filterClose MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.1) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >> OK. Once close() is called on BaseIoSession, its state switches to >> 'closing'. >> >> In this state, calling write() leads to calling >> WriteFuture.newNotWrittenFuture() which returns a 'fake' WriteFuture >> without enqueuing the request. >> >> So, you cannot write message to a closing session. > > > I thought we can write a message in filterClose() by doing like this: > > void filterClose(...) { > WriteFuture future = next.filterWrite(...); > future.setCallback(new IoFuture.Callback() { > public void operationComplete(...) { > future.getSession().close(); > } > }); > } > > If this doesn't work, this is a bug. > > HTH, > Trustin This works. I was calling session.write(). BTW. When sending messages from my filter, filterWrite of this filter is called. When closing session from my filter, filterClose is not called. Is it normal? Thanks, J-F From mina-dev-returnlauren93@example.org Mon Jul 03 09:15:13 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 8152 invoked from network); 3 Jul 2006 09:15:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 09:15:13 -0000 Received: (qmail 27429 invoked by uid 500); 3 Jul 2006 09:15:12 -0000 Delivered-To: lauren93@example.org Received: (qmail 27421 invoked by uid 500); 3 Jul 2006 09:15:12 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 27410 invoked by uid 99); 3 Jul 2006 09:15:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:15:12 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lauren93@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:15:11 -0700 Received: by py-out-1112.google.com with SMTP id s49so615476pyc for <lauren93@example.org>; Mon, 03 Jul 2006 02:14:51 -0700 (PDT) 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=W1U/g6k/Fzb1zaeeuRAKw+Fzf1anfpXSp96RjVLO+sxle6y6nbcJteZchq9bXij/xjsV4N8Vpv6+u9RYl4JT/ZtPUJeIXVRWhwhTB29X+WzLODQFZCEOlk7JOlQqkgqk8BS5z1syB2KlBjQem6xzJssgEz832TRVoWI4bwMTE9o= Received: by 83.161.120.155 with SMTP id f13mr709483pyl; Mon, 03 Jul 2006 02:14:50 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 3 Jul 2006 02:14:50 -0700 (PDT) Message-ID: <lauren93@example.org> Date: Mon, 3 Jul 2006 18:14:50 +0900 From: "Trustin Lee" <lauren93@example.org> To: lauren93@example.org Subject: Re: Sendind message in filterClose In-Reply-To: <lauren93@example.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_56080_28031657.1151918090872" References: <lauren93@example.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_56080_28031657.1151918090872 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/3/06, lauren93@example.org <lauren93@example.org> wrote: > > >> OK. Once close() is called on BaseIoSession, its state switches to > >> 'closing'. > >> > >> In this state, calling write() leads to calling > >> WriteFuture.newNotWrittenFuture() which returns a 'fake' WriteFuture > >> without enqueuing the request. > >> > >> So, you cannot write message to a closing session. > > > > > > I thought we can write a message in filterClose() by doing like this: > > > > void filterClose(...) { > > WriteFuture future = next.filterWrite(...); > > future.setCallback(new IoFuture.Callback() { > > public void operationComplete(...) { > > future.getSession().close(); > > } > > }); > > } > > > > If this doesn't work, this is a bug. > > > > HTH, > > Trustin > > This works. I was calling session.write(). > > BTW. When sending messages from my filter, filterWrite of this filter > is called. > > When closing session from my filter, filterClose is not called. Is it > normal? It should be called later when the returned writefuture notifies the callback. As you see, there's a call to IoSession.close() in operationComplete() method implementation above. So, the bottom line is that it should be called later, but not immediately. If not, it's a bug, too. :) HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_56080_28031657.1151918090872-- From mina-dev-returnlauren93@example.org Mon Jul 03 09:22:15 2006 Return-Path: <mina-dev-returnlauren93@example.org> Delivered-To: lauren93@example.org Received: (qmail 10282 invoked from network); 3 Jul 2006 09:22:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jul 2006 09:22:14 -0000 Received: (qmail 45337 invoked by uid 500); 3 Jul 2006 09:22:14 -0000 Delivered-To: lauren93@example.org Received: (qmail 45318 invoked by uid 500); 3 Jul 2006 09:22:14 -0000 Mailing-List: contact lauren93@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:lauren93@example.org> List-Unsubscribe: <mailto:lauren93@example.org> List-Post: <mailto:lauren93@example.org> List-Id: <mina-dev.directory.apache.org> Reply-To: lauren93@example.org Delivered-To: mailing list lauren93@example.org Received: (qmail 45309 invoked by uid 99); 3 Jul 2006 09:22:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:22:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 02:22:13 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 3047E410392 for <lauren93@example.org>; Mon, 3 Jul 2006 09:20:30 +0000 (GMT) Message-ID: <22814730.1151918430179.JavaMail.jira@brutus> Date: Mon, 3 Jul 2006 09:20:30 +0000 (GMT+00:00) From: "Trustin Lee (JIRA)" <lauren93@example.org> To: lauren93@example.org Subject: [jira] Reopened: (DIRMINA-208) Allow datagrams to be directed to a specific destination on a per-datagram instead of a per-session basis. In-Reply-To: <4812827.1146212260098.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIRMINA-208?page=3Dall ] =20 Trustin Lee reopened DIRMINA-208: --------------------------------- I am terribly sorry for this problem. I will apply your patch soon. =20 > Allow datagrams to be directed to a specific destination on a per-datagra= m instead of a per-session basis. > -------------------------------------------------------------------------= --------------------------------- > > Key: DIRMINA-208 > URL: http://issues.apache.org/jira/browse/DIRMINA-208 > Project: Directory MINA > Type: Wish > Versions: 0.9.3 > Reporter: J=C3=B6rg Henne > Assignee: Trustin Lee > Fix For: 0.9.5 > Attachments: pcf.patch > > [this is a copy of a message I sent to the mailing-list a few days ago] > A few weeks ago I started to work on the DS DHCP server. Work has progres= sed so far that clients can successfully register IP addresses with the ser= ver and all, although the code is still unfit for general consumption. > Ir order to implement the DHCP functionality, however, it was necessary t= o apply a minor patch to the MINA code base. The patch is necessitated by t= he fact that packets which are received via broadcast from a DHCP client do= n't have a proper source address. As a consequence, the reply messages must= also be broadcast (or, in some cases sent by unicast to a different addres= s). The existing code created a new MINA IoSession per message in order to = handle this case, causing quite a lot of overhead and, worse, a new thread = which lingered even after it was done. > In order to do away with the overhead, I introduced a special session att= ribute which allows me to re-direct a message while it is sent like this: > InetSocketAddress isa =3D determineMessageDestination( request= , reply ); > session.setAttribute( "destination", isa ); > session.write( reply ); > This property is used in DatagramAcceptorDelegate.flush(DatagramSessionIm= pl) to override the message destination address like this: > ... > if ( !key.isValid() ) > { > continue; > } > // HACK: allow destination to be overridden using session attr= ibute. > SocketAddress destination =3D session.getRemoteAddress(); > Object d =3D session.getAttribute( "destination" ); > if ( null !=3D d && d instanceof SocketAddress ) > destination =3D ( SocketAddress ) d; > int writtenBytes =3D ch.send( buf.buf(), destination ); > ... > I am not too happy with this hack, but it was easy and worked. I you coul= d come up with a more general and elegant solution, I'd be more than happy. > Joerg Henne --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more
{'source': 'Apache Software Foundation Public Mail Archives'}