You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Zhang (JIRA)" <ji...@apache.org> on 2006/07/17 10:11:14 UTC
[jira] Updated: (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 ]
Andrew Zhang updated HARMONY-889:
---------------------------------
Attachment: nio.diff
Hello,
Would you please try my patch? Thanks!
The patch fixes following problems:
1. Revise SocketChannelInputStream and SocketChannelOutputStream, delegate all operations to the associated channel according to spec.
2. An exception thrown compatibility bug.
Best regards,
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
> 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