equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2019, 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 |
38 import java.util.concurrent.Future; |
38 import java.util.concurrent.Future; |
39 import java.util.concurrent.locks.ReadWriteLock; |
39 import java.util.concurrent.locks.ReadWriteLock; |
40 import java.util.concurrent.locks.ReentrantReadWriteLock; |
40 import java.util.concurrent.locks.ReentrantReadWriteLock; |
41 import sun.net.NetHooks; |
41 import sun.net.NetHooks; |
42 import sun.net.ext.ExtendedSocketOptions; |
42 import sun.net.ext.ExtendedSocketOptions; |
43 import static sun.net.ext.ExtendedSocketOptions.SOCK_STREAM; |
|
44 |
43 |
45 /** |
44 /** |
46 * Base implementation of AsynchronousServerSocketChannel. |
45 * Base implementation of AsynchronousServerSocketChannel. |
47 */ |
46 */ |
48 |
47 |
234 set.add(StandardSocketOptions.SO_RCVBUF); |
233 set.add(StandardSocketOptions.SO_RCVBUF); |
235 set.add(StandardSocketOptions.SO_REUSEADDR); |
234 set.add(StandardSocketOptions.SO_REUSEADDR); |
236 if (Net.isReusePortAvailable()) { |
235 if (Net.isReusePortAvailable()) { |
237 set.add(StandardSocketOptions.SO_REUSEPORT); |
236 set.add(StandardSocketOptions.SO_REUSEPORT); |
238 } |
237 } |
239 set.addAll(ExtendedSocketOptions.options(SOCK_STREAM)); |
238 set.addAll(ExtendedSocketOptions.serverSocketOptions()); |
240 return Collections.unmodifiableSet(set); |
239 return Collections.unmodifiableSet(set); |
241 } |
240 } |
242 } |
241 } |
243 |
242 |
244 @Override |
243 @Override |