diff -r a5ed9456c9be -r 0676e37a0b9c jdk/src/java.base/windows/classes/java/net/TwoStacksPlainSocketImpl.java --- a/jdk/src/java.base/windows/classes/java/net/TwoStacksPlainSocketImpl.java Tue Feb 23 09:49:04 2016 +0100 +++ b/jdk/src/java.base/windows/classes/java/net/TwoStacksPlainSocketImpl.java Tue Feb 23 17:41:00 2016 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -128,6 +128,9 @@ } else if (opt == SO_REUSEADDR && exclusiveBind) { // SO_REUSEADDR emulated when using exclusive bind return isReuseAddress; + } else if (opt == SO_REUSEPORT) { + // SO_REUSEPORT is not supported on Windows. + throw new UnsupportedOperationException("unsupported option"); } else return super.getOption(opt); } @@ -144,6 +147,10 @@ // SO_REUSEADDR emulated when using exclusive bind if (opt == SO_REUSEADDR && exclusiveBind) isReuseAddress = on; + else if (opt == SO_REUSEPORT) { + // SO_REUSEPORT is not supported on Windows. + throw new UnsupportedOperationException("unsupported option"); + } else socketNativeSetOption(opt, on, value); }