JDK-7096436 : (sc) SocketChannel.connect fails on Windows 8 when channel configured non-blocking
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7,8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_7
  • CPU: generic,x86
  • Submitted: 2011-09-29
  • Updated: 2012-11-01
  • Resolved: 2012-05-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u6Fixed 8 b40Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
Jeroen Frijters points out that Windows 8 has changed getsockname so that it fails with WASINVAL if calls immediately after connect and the connection hasn't been established yet:

http://mail.openjdk.java.net/pipermail/net-dev/2011-September/003594.html
src/share/classes/sun/nio/ch/SocketChannelImpl.java

Comments
7-na should not be on this issue, the reason is that it affected 7 too. Consequentially I have removed the label.
01-11-2012

Added 7-na as it was already backported to JDK 7.
01-11-2012

EVALUATION This CR does not need a backport to 6, since the original fix that introduces this problem (4640544) was not backported to 6.
29-06-2012

EVALUATION Changeset: 5152c832745a Author: khazra Date: 2012-05-09 16:55 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5152c832745a 7096436: (sc) SocketChannel.connect fails on Windows 8 when channel configured non-blocking Summary: Set localAddress only when connection is established Reviewed-by: alanb ! src/share/classes/sun/nio/ch/SocketChannelImpl.java
10-05-2012

EVALUATION This seems to be a behavior change in Windows 8 but it does highlight that we assume that getsockname will return the local address even for the case that the connection is not yet established.
29-09-2011