harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject [classlib][nio][discussion] Implementation of java.nio.channels.spi.SelectorProvider.inheritedChannel()
Date Thu, 13 Jul 2006 05:48:18 GMT
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:

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?) Therefore, I want to hear suggestions from our community,
espeically folks experienced in network!

Many thanks in advance!

Best regards,

-- 
Andrew Zhang
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message