DatagramCahnnel scatter/gather problem on diablo 1.6.0_07-b02
Joe Lin
jlin at maxiscale.com
Mon Feb 1 01:08:57 UTC 2010
Thanks for the reply. I looked at JDK source code and it appears that the JNI call should be in
J2se/src/solaris/native/sun/nio/ch/DatagramDispatcher.c:write0():
There's only linux and solaris #ifdef but not for BSD. I wonder how/what BSD is calling. Since I'm getting a "IOException:Invalid argument" so I guess this should correspond to a EINVAL. And a sendmsg() in FreeBSD does not return an EINVAL. So the Diablo port must be calling a writev(). But I could not locate the source code. Wish I can find out what went wrong with dialblo VM.
Thanks.
-----Original Message-----
From: Pieter de Goeje [mailto:pieter at degoeje.nl]
Sent: Sunday, January 31, 2010 4:45 PM
To: freebsd-java at freebsd.org
Cc: Joe Lin
Subject: Re: DatagramCahnnel scatter/gather problem on diablo 1.6.0_07-b02
On Monday 01 February 2010 01:01:38 Joe Lin wrote:
> Hi I wrote a sample program trying to use
> DatagramChannel.write(ByteBuffer[] bufs). The exact same code works on
> Windows and Linux. But it fails on the Diablo VM under FreeBSD 7.0 64 bit.
> The exception:
>
> Exception in thread "main" java.io.IOException: Invalid argument
> at sun.nio.ch.DatagramDispatcher.writev0(Native Method)
> at sun.nio.ch.DatagramDispatcher.writev(DatagramDispatcher.java:37)
> at sun.nio.ch.IOUtil.write(IOUtil.java:164)
> at
> sun.nio.ch.DatagramChannelImpl.write0(DatagramChannelImpl.java:414) at
> sun.nio.ch.DatagramChannelImpl.write(DatagramChannelImpl.java:431) at
> java.nio.channels.DatagramChannel.write(DatagramChannel.java:418) at
> coco.McastSender.main(McastSender.java:68).
I can confirm it also doesn't work on FreeBSD 8/i386 and amd64 using jdk6 or
openjdk6. I find it odd why it works on Linux because they have exactly the
same writev(2) as we do. Scatter/gather I/O isn't very often used so I guess
you're the first one that has run into this problem.
--
Pieter de Goeje
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2649 - Release Date: 01/30/10 22:39:00
More information about the freebsd-java
mailing list