src/share/classes/sun/nio/ch/SocketChannelImpl.java

Print this page
rev 7398 : 8032808: Support Solaris SO_FLOW_SLA socket option
Reviewed-by: michaelm
rev 7400 : 8029607: Type of Service (TOS) cannot be set in IPv6 header
Reviewed-by: alanb

*** 31,40 **** --- 31,41 ---- import java.nio.ByteBuffer; import java.nio.channels.*; import java.nio.channels.spi.*; import java.util.*; import sun.net.NetHooks; + import sun.net.ExtendedOptionsImpl; import sun.misc.IoTrace; /** * An implementation of SocketChannels */
*** 170,187 **** synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); - // special handling for IP_TOS: no-op when IPv6 if (name == StandardSocketOptions.IP_TOS) { ! if (!Net.isIPv6Available()) ! Net.setSocketOption(fd, StandardProtocolFamily.INET, name, value); return this; ! } else if (name == StandardSocketOptions.SO_REUSEADDR && ! Net.useExclusiveBind()) ! { // SO_REUSEADDR emulated when using exclusive bind isReuseAddress = (Boolean)value; return this; } --- 171,188 ---- synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); if (name == StandardSocketOptions.IP_TOS) { ! ProtocolFamily family = Net.isIPv6Available() ? ! StandardProtocolFamily.INET6 : StandardProtocolFamily.INET; ! Net.setSocketOption(fd, family, name, value); return this; ! } ! ! if (name == StandardSocketOptions.SO_REUSEADDR && Net.useExclusiveBind()) { // SO_REUSEADDR emulated when using exclusive bind isReuseAddress = (Boolean)value; return this; }
*** 212,223 **** return (T)Boolean.valueOf(isReuseAddress); } // special handling for IP_TOS: always return 0 when IPv6 if (name == StandardSocketOptions.IP_TOS) { ! return (Net.isIPv6Available()) ? (T) Integer.valueOf(0) : ! (T) Net.getSocketOption(fd, StandardProtocolFamily.INET, name); } // no options that require special handling return (T) Net.getSocketOption(fd, Net.UNSPEC, name); } --- 213,225 ---- return (T)Boolean.valueOf(isReuseAddress); } // special handling for IP_TOS: always return 0 when IPv6 if (name == StandardSocketOptions.IP_TOS) { ! ProtocolFamily family = Net.isIPv6Available() ? ! StandardProtocolFamily.INET6 : StandardProtocolFamily.INET; ! return (T) Net.getSocketOption(fd, family, name); } // no options that require special handling return (T) Net.getSocketOption(fd, Net.UNSPEC, name); }
*** 235,244 **** --- 237,249 ---- set.add(StandardSocketOptions.SO_LINGER); set.add(StandardSocketOptions.TCP_NODELAY); // additional options required by socket adaptor set.add(StandardSocketOptions.IP_TOS); set.add(ExtendedSocketOption.SO_OOBINLINE); + if (ExtendedOptionsImpl.flowSupported()) { + set.add(jdk.net.ExtendedSocketOptions.SO_FLOW_SLA); + } return Collections.unmodifiableSet(set); } } @Override