< prev index next >
src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -83,14 +83,22 @@
}
}
protected Set<SocketOption<?>> supportedOptions() {
HashSet<SocketOption<?>> options = new HashSet<>(super.supportedOptions());
- options.addAll(extendedOptions.options());
+ addExtSocketOptions(extendedOptions.options(), options);
return options;
}
+ private void addExtSocketOptions(Set<SocketOption<?>> extOptions,
+ Set<SocketOption<?>> options) {
+ extOptions.stream().filter((option) -> (!option.name().
+ equals("TCP_QUICKACK"))).forEachOrdered((option) -> {
+ options.add(option);
+ }); // TCP_QUICKACK is applicable for TCP Sockets only.
+ }
+
protected void socketSetOption(int opt, Object val) throws SocketException {
if (opt == SocketOptions.SO_REUSEPORT &&
!supportedOptions().contains(StandardSocketOptions.SO_REUSEPORT)) {
throw new UnsupportedOperationException("unsupported option");
}
< prev index next >