equal
deleted
inserted
replaced
310 |
310 |
311 private static native boolean canIPv6SocketJoinIPv4Group0(); |
311 private static native boolean canIPv6SocketJoinIPv4Group0(); |
312 |
312 |
313 private static native boolean canJoin6WithIPv4Group0(); |
313 private static native boolean canJoin6WithIPv4Group0(); |
314 |
314 |
315 static FileDescriptor socket(boolean stream) { |
315 static FileDescriptor socket(boolean stream) throws IOException { |
316 return socket(UNSPEC, stream); |
316 return socket(UNSPEC, stream); |
317 } |
317 } |
318 |
318 |
319 static FileDescriptor socket(ProtocolFamily family, boolean stream) { |
319 static FileDescriptor socket(ProtocolFamily family, boolean stream) |
|
320 throws IOException { |
320 boolean preferIPv6 = isIPv6Available() && |
321 boolean preferIPv6 = isIPv6Available() && |
321 (family != StandardProtocolFamily.INET); |
322 (family != StandardProtocolFamily.INET); |
322 return IOUtil.newFD(socket0(preferIPv6, stream, false)); |
323 return IOUtil.newFD(socket0(preferIPv6, stream, false)); |
323 } |
324 } |
324 |
325 |