Changing the value of the IP_TOS or IPV6_TCLASS socket options on a TCP socket that is already connected is implementation specific, and in many cases doesn't really make sense. However, if attempted and the setting the options fails (it fails on Solaris) then the error is swallowed by Socket setTrafficClass(value) but is not swallowed by setOption(IP_TOS, value). This inconsistency surfaces when when PlainSocketImpl is replaced with an alternative implementation. The issue has been patched in the niosocketimpl-branch, and tracked here so that it can be examined on its own.