You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "George Harley (JIRA)" <ji...@apache.org> on 2006/07/18 11:40:18 UTC

[jira] Closed: (HARMONY-889) [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.

     [ http://issues.apache.org/jira/browse/HARMONY-889?page=all ]

George Harley closed HARMONY-889.
---------------------------------


Verified by Andrew.

> [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
>         Assigned To: George Harley
>         Attachments: nio.diff
>
>
> 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