You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2007/02/16 14:44:05 UTC

[jira] Assigned: (HARMONY-3185) [classlib][nio] DatagramChannel.send() does not work if the ByteBuffer is exhausted to it's limit

     [ https://issues.apache.org/jira/browse/HARMONY-3185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov reassigned HARMONY-3185:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][nio] DatagramChannel.send() does not work if the ByteBuffer is exhausted to it's limit
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3185
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3185
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: WinXP, IA32
>            Reporter: Mikhail Markov
>         Assigned To: Alexei Zakharov
>         Attachments: H-3185.patch
>
>
> I have 9 constant fails in nio modules for DatagramChannelTest:
>   testSend_NoServerTwice(),
>   testSend_NoServerNonBlockingTwice(),
>   testReceiveSend_Block_Empty(),
>   testReceiveSend_NonBlock_Empty(),
>   testReceiveSend_Block_Empty_S2C(),
>   testReceiveSend_NonBlock_Empty_S2C(),
>   testReceiveSend_Block_Empty_C2S(),
>   testReceiveSend_NonBlock_Empty_C2S(),
>   testReceiveSend_Empty_S2S()
> Here is the simple testcase reproducing the problem:
> On RI it silently passes, but on Harmony it fails with this message: "(10040) A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself."
> ----------- Test.java --------------
> import java.io.IOException;
> import java.net.*;
> import java.nio.*;
> import java.nio.channels.*;
> public class Test {
>     public static void main (String[] argv) throws Exception {
>         ByteBuffer writeBuf = ByteBuffer.allocateDirect(200);
>         DatagramChannel channel = DatagramChannel.open();
>         InetSocketAddress localAddr = new InetSocketAddress("127.0.0.1",
>                 getNextPort());
>         channel.send(writeBuf, localAddr);
>         channel.connect(localAddr);
>         channel.send(writeBuf, localAddr);
>     }
>     private static int getNextPort() throws IOException {
>         ServerSocket ss = new ServerSocket(0);
>         int port = ss.getLocalPort();
>         ss.close();
>         return port;
>     }
> }
> ------------------------------
> I'll provide a patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.