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

Reply via email to