You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Markov (JIRA)" <ji...@apache.org> on 2007/03/29 16:15:25 UTC

[jira] Closed: (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 ]

Mikhail Markov closed HARMONY-3185.
-----------------------------------

    Resolution: Invalid

It seemps that the issue is reproducible on machines with very specific configurations. There were several discussions in the mailing list regarding this, but we could not detected the reason for the failure. Moreover, the simplest test:
import java.net.DatagramSocket;
import java.net.DatagramPacket;
import java.net.InetAddress;

public class Test {
    public static void main(String[] args) throws Exception {
        DatagramSocket ds = new DatagramSocket();
        DatagramPacket dp = new DatagramPacket(new byte[0], 0, InetAddress.getLocalHost(), 5555);
        ds.send(dp);
    }
}
fails on my machine on RI as well.

So, closing the issue as 'Invalid'.

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