harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-889) [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
Date Mon, 17 Jul 2006 07:45:14 GMT
[classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of
its operations to the associated channel. 
---------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-889
                 URL: http://issues.apache.org/jira/browse/HARMONY-889
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Andrew Zhang


SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations
to the associated channel. 

Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.

Following test reproduces a bug caused by current implementation:

    public void test_getOutputStream() throws Exception {
        ServerSocket ss = new ServerSocket(0);
        SocketChannel sc = SocketChannel.open();

        sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
        OutputStream os = sc.socket().getOutputStream();
        os.close();
        try {
            os.write(1);
            fail("should throw ClosedChannelException");
        } catch (ClosedChannelException e) {
            // expected
        } 
    }

The test passes against RI while fails against Harmony.

I'll upload a patch to fix this problem and supplement more tests. 

Thanks.

Best regards,
Andrew

-- 
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

        

Mime
View raw message