equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
506 HashSet<SocketOption<?>> set = new HashSet<>(5); |
506 HashSet<SocketOption<?>> set = new HashSet<>(5); |
507 set.add(StandardSocketOptions.SO_SNDBUF); |
507 set.add(StandardSocketOptions.SO_SNDBUF); |
508 set.add(StandardSocketOptions.SO_RCVBUF); |
508 set.add(StandardSocketOptions.SO_RCVBUF); |
509 set.add(StandardSocketOptions.SO_KEEPALIVE); |
509 set.add(StandardSocketOptions.SO_KEEPALIVE); |
510 set.add(StandardSocketOptions.SO_REUSEADDR); |
510 set.add(StandardSocketOptions.SO_REUSEADDR); |
|
511 if (Net.isReusePortAvailable()) { |
|
512 set.add(StandardSocketOptions.SO_REUSEPORT); |
|
513 } |
511 set.add(StandardSocketOptions.TCP_NODELAY); |
514 set.add(StandardSocketOptions.TCP_NODELAY); |
512 if (ExtendedOptionsImpl.flowSupported()) { |
515 if (ExtendedOptionsImpl.flowSupported()) { |
513 set.add(jdk.net.ExtendedSocketOptions.SO_FLOW_SLA); |
516 set.add(jdk.net.ExtendedSocketOptions.SO_FLOW_SLA); |
514 } |
517 } |
515 return Collections.unmodifiableSet(set); |
518 return Collections.unmodifiableSet(set); |