United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7176630 (sc) SocketChannel.write does not write more than 128k when channel configured blocking [win]
JDK-7176630 : (sc) SocketChannel.write does not write more than 128k when channel configured blocking [win]

Details
Type:
Bug
Submit Date:
2012-06-13
Status:
Closed
Updated Date:
2014-02-09
Project Name:
JDK
Resolved Date:
2012-07-09
Component:
core-libs
OS:
generic
Sub-Component:
java.nio
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description
Windows does not support asynchronous close on sockets when doing blocking operations with a buffer size >= 128k. The long standing Microsoft recommendation is to limit such I/O operations to 64k. Since 6395224 then we limit I/O operations to 128k-1 so that asynchronous close works as specified but a side effect of this is that attempts to write 128k+ bytes will be result in a short write. This is not an issue for applications that check the return value from write but is a problem for applications that don't check the return value. This bug is submitted to re-visit this issue with a view to the write(ByteBuffer) method writing as many bytes as possible.

                                    

Comments
EVALUATION

As per the description, we should write as many bytes as possible when in blocking mode.
                                     
2012-06-13



Hardware and Software, Engineered to Work Together