7176630: (sc) SocketChannel.write does not write more than 128k when channel configured blocking [win]
Diego Belfer
dbelfer at gmail.com
Wed Jun 13 12:14:05 PDT 2012
Hi Alan,
Do you know if the WSASend function may return SOCKET_ERROR and still have
written some bytes to the underlying socket? (I read the doc for WSASend
function and it is not clear for me if it is possible or not) If that is
possible, you may need to "add" written to count before the "if" in order
to return the count.
Best,
Diego
On Wed, Jun 13, 2012 at 10:54 AM, Alan Bateman <Alan.Bateman at oracle.com>wrote:
>
> I need a reviewer for a small change to the SocketChannel.write
> implementation on Windows. The issue on Windows is that we limit the buffer
> size to 128k-1 because asynchronous close doesn't work on Windows for sizes
> later than that (the long standing Microsoft recommendation is to use
> <=64k). The issue with limiting the size of the I/O operation is that the
> write method may return a value less than what is expected when the channel
> is configured blocking and this can cause problem for applications that
> don't check the return value. The changes just convert the large write into
> multiple calls to WSASend. The webrev with the changes is here:
>
> http://cr.openjdk.java.net/~**alanb/7176630/webrev/<http://cr.openjdk.java.net/%7Ealanb/7176630/webrev/>
>
> Thanks,
> Alan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20120613/972f4654/attachment.html
More information about the nio-dev
mailing list