Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 60643 invoked from network); 13 Jul 2006 06:32:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2006 06:32:35 -0000 Received: (qmail 90960 invoked by uid 500); 13 Jul 2006 06:32:33 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 90543 invoked by uid 500); 13 Jul 2006 06:32:31 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 90532 invoked by uid 99); 13 Jul 2006 06:32:31 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2006 23:32:31 -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 zhanghuangzhu@gmail.com designates 66.249.82.196 as permitted sender) Received: from [66.249.82.196] (HELO wx-out-0102.google.com) (66.249.82.196) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2006 23:32:30 -0700 Received: by wx-out-0102.google.com with SMTP id t13so46240wxc for ; Wed, 12 Jul 2006 23:32:09 -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=Gj8ceaX69pFM0G2VlJm5ALzZukxxM9NZ/Gk+e7hPvZreS6jN0E+tU5SCR++X44FfpKDrG7U6rtByUlIwH+6qs5AsVqdITveTpJ3jRWAxTXBJ4/drv7uH8e5sJ75djCi+GtMarKvPi7mdx7d1lW8Wk9RVNjAoO++A/zK7cghZuFc= Received: by 10.70.37.4 with SMTP id k4mr635068wxk; Wed, 12 Jul 2006 23:32:09 -0700 (PDT) Received: by 10.70.118.15 with HTTP; Wed, 12 Jul 2006 23:32:09 -0700 (PDT) Message-ID: <4d0b24970607122332u2fef44e0sd062cfd8c12f4087@mail.gmail.com> Date: Thu, 13 Jul 2006 14:32:09 +0800 From: "Andrew Zhang" To: harmony-dev@incubator.apache.org Subject: Re: [classlib][nio][discussion] Implementation of java.nio.channels.spi.SelectorProvider.inheritedChannel() In-Reply-To: <44B5E5ED.70905@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3024_11806849.1152772329715" References: <4d0b24970607122248w39b3e136h549755cf2d327bf7@mail.gmail.com> <44B5E5ED.70905@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_3024_11806849.1152772329715 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/13/06, Paulex Yang wrote: > > Andrew Zhang wrote: > > Hello everybody, > > > > I plan to implement > > java.nio.channels.spi.SelectorProvider.inheritedChannel() > > method. Currently Harmony simply returns null. > > > > Spec doesn not specify how to detect inheritedChannel clearly, > > "Returns the > > channel inherited from the entity that created this Java virtual > > machine." > > "For example, on UNIX systems, the Internet services daemon (*inetd*) is > > used to start programs to service requests when a request arrives on an > > associated network port. In this example, the process that is started, > > inherits a channel representing a network socket. " > > > > As my understanding, what inherited channel does is redirect socket to > > standard input. Therefore, my solution looks like following: > Don't need to check the stdout? IIRC inetd redirects both. Paulex, I don't thin it's necessary. Even if stdout/stderr are not redirected, RI still returns inherited channel as long as stdin is redirected on Linux. > > > 1. get standard input file descriptor > > 2. assert the file descriptor. If it is a socket type descriptor, then > > returns a channel which wraps the descriptor. > > > > I also wrote some samples for ensuring my understanding. It seems OK on > > linux, but not the case on Window. RI always returns null on Windows > > (maybe > > because there is no service daemon program on Windows? or my > > understanding > > is totally wrong?) > Any chance to get non-null value if inetd is dummied on Windows? Seems > some Services for UNIX(SFU) is provided by MS with Windows server 2003, > which can mimic the inetd behavior[1]. I'm not sure if it applies to > WinXP, too. > > > [1]http://www.microsoft.com/technet/interopmigration/unix/sfu/intdrutil.mspx > > > Therefore, I want to hear suggestions from our community, > > espeically folks experienced in network! > > > > Many thanks in advance! > > > > Best regards, > > > > > -- > Paulex Yang > China Software Development Lab > IBM > > > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > -- Andrew Zhang China Software Development Lab, IBM ------=_Part_3024_11806849.1152772329715--