harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3185) [classlib][nio] DatagramChannel.send() does not work if the ByteBuffer is exhausted to it's limit
Date Thu, 15 Feb 2007 17:17:05 GMT
[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


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.


Mime
View raw message