author | alanb |
Sat, 30 Nov 2019 16:21:19 +0000 | |
changeset 59329 | 289000934908 |
parent 58614 | 29624901d8bc |
child 58801 | 119ac9128c1b |
permissions | -rw-r--r-- |
2 | 1 |
/* |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
2 |
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.nio.ch; |
|
27 |
||
48761 | 28 |
import java.io.IOException; |
29 |
import java.net.InetAddress; |
|
30 |
import java.net.InetSocketAddress; |
|
31 |
import java.net.ServerSocket; |
|
32 |
import java.net.Socket; |
|
33 |
import java.net.SocketAddress; |
|
34 |
import java.net.SocketException; |
|
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
35 |
import java.net.SocketOption; |
48761 | 36 |
import java.net.StandardSocketOptions; |
37 |
import java.nio.channels.IllegalBlockingModeException; |
|
38 |
import java.nio.channels.ServerSocketChannel; |
|
39 |
import java.nio.channels.SocketChannel; |
|
58614
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
40 |
import java.security.AccessController; |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
41 |
import java.security.PrivilegedActionException; |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
42 |
import java.security.PrivilegedExceptionAction; |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
43 |
import java.util.Set; |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
44 |
|
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
45 |
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
2 | 46 |
|
47 |
||
48 |
// Make a server-socket channel look like a server socket. |
|
49 |
// |
|
50 |
// The methods in this class are defined in exactly the same order as in |
|
51 |
// java.net.ServerSocket so as to simplify tracking future changes to that |
|
52 |
// class. |
|
53 |
// |
|
54 |
||
48761 | 55 |
class ServerSocketAdaptor // package-private |
2 | 56 |
extends ServerSocket |
57 |
{ |
|
58 |
// The channel being adapted |
|
59 |
private final ServerSocketChannelImpl ssc; |
|
60 |
||
61 |
// Timeout "option" value for accepts |
|
34774
03b4e6dc367b
8145680: Remove unnecessary explicit initialization of volatile variables in java.base
redestad
parents:
25859
diff
changeset
|
62 |
private volatile int timeout; |
2 | 63 |
|
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
64 |
static ServerSocket create(ServerSocketChannelImpl ssc) { |
58614
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
65 |
PrivilegedExceptionAction<ServerSocket> pa = () -> new ServerSocketAdaptor(ssc); |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
66 |
try { |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
67 |
return AccessController.doPrivileged(pa); |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
68 |
} catch (PrivilegedActionException pae) { |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
69 |
throw new InternalError("Should not reach here", pae); |
29624901d8bc
8223326: Regression introduced by CPU sync: java.security.AccessControlException: access denied ("java.net.NetPermission" "setSocketImpl")
aefimov
parents:
54620
diff
changeset
|
70 |
} |
2 | 71 |
} |
72 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
73 |
private ServerSocketAdaptor(ServerSocketChannelImpl ssc) { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
74 |
super(DummySocketImpl.create()); |
2 | 75 |
this.ssc = ssc; |
76 |
} |
|
77 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
78 |
@Override |
2 | 79 |
public void bind(SocketAddress local) throws IOException { |
80 |
bind(local, 50); |
|
81 |
} |
|
82 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
83 |
@Override |
2 | 84 |
public void bind(SocketAddress local, int backlog) throws IOException { |
85 |
if (local == null) |
|
86 |
local = new InetSocketAddress(0); |
|
87 |
try { |
|
88 |
ssc.bind(local, backlog); |
|
89 |
} catch (Exception x) { |
|
90 |
Net.translateException(x); |
|
91 |
} |
|
92 |
} |
|
93 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
94 |
@Override |
2 | 95 |
public InetAddress getInetAddress() { |
49001
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
96 |
InetSocketAddress local = ssc.localAddress(); |
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
97 |
if (local == null) { |
2 | 98 |
return null; |
49001
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
99 |
} else { |
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
100 |
return Net.getRevealedLocalAddress(local).getAddress(); |
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
101 |
} |
2 | 102 |
} |
103 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
104 |
@Override |
2 | 105 |
public int getLocalPort() { |
49001
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
106 |
InetSocketAddress local = ssc.localAddress(); |
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
107 |
if (local == null) { |
2 | 108 |
return -1; |
49001
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
109 |
} else { |
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
110 |
return local.getPort(); |
ce06058197a4
8198562: (ch) Separate blocking and non-blocking code paths (part 1)
alanb
parents:
48761
diff
changeset
|
111 |
} |
2 | 112 |
} |
113 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
114 |
@Override |
2 | 115 |
public Socket accept() throws IOException { |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
116 |
SocketChannel sc = null; |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
117 |
try { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
118 |
int timeout = this.timeout; |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
119 |
if (timeout > 0) { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
120 |
long nanos = MILLISECONDS.toNanos(timeout); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
121 |
sc = ssc.blockingAccept(nanos); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
122 |
} else { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
123 |
// accept connection if possible when non-blocking (to preserve |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
124 |
// long standing behavior) |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
125 |
sc = ssc.accept(); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
126 |
if (sc == null) { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
127 |
throw new IllegalBlockingModeException(); |
2 | 128 |
} |
129 |
} |
|
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
130 |
} catch (Exception e) { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
131 |
Net.translateException(e); |
2 | 132 |
} |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
133 |
return sc.socket(); |
2 | 134 |
} |
135 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
136 |
@Override |
2 | 137 |
public void close() throws IOException { |
5784
e565c553e9fc
6938230: (so) SocketAdaptor.close() does not translate IOException resulting in Error
alanb
parents:
5506
diff
changeset
|
138 |
ssc.close(); |
2 | 139 |
} |
140 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
141 |
@Override |
2 | 142 |
public ServerSocketChannel getChannel() { |
143 |
return ssc; |
|
144 |
} |
|
145 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
146 |
@Override |
2 | 147 |
public boolean isBound() { |
148 |
return ssc.isBound(); |
|
149 |
} |
|
150 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
151 |
@Override |
2 | 152 |
public boolean isClosed() { |
153 |
return !ssc.isOpen(); |
|
154 |
} |
|
155 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
156 |
@Override |
2 | 157 |
public void setSoTimeout(int timeout) throws SocketException { |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
158 |
if (!ssc.isOpen()) |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
159 |
throw new SocketException("Socket is closed"); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
160 |
if (timeout < 0) |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
161 |
throw new IllegalArgumentException("timeout < 0"); |
2 | 162 |
this.timeout = timeout; |
163 |
} |
|
164 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
165 |
@Override |
2 | 166 |
public int getSoTimeout() throws SocketException { |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
167 |
if (!ssc.isOpen()) |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
168 |
throw new SocketException("Socket is closed"); |
2 | 169 |
return timeout; |
170 |
} |
|
171 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
172 |
@Override |
2 | 173 |
public void setReuseAddress(boolean on) throws SocketException { |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
174 |
try { |
9679
d98ae8bc45fc
7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents:
7668
diff
changeset
|
175 |
ssc.setOption(StandardSocketOptions.SO_REUSEADDR, on); |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
176 |
} catch (IOException x) { |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
177 |
Net.translateToSocketException(x); |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
178 |
} |
2 | 179 |
} |
180 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
181 |
@Override |
2 | 182 |
public boolean getReuseAddress() throws SocketException { |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
183 |
try { |
9679
d98ae8bc45fc
7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents:
7668
diff
changeset
|
184 |
return ssc.getOption(StandardSocketOptions.SO_REUSEADDR).booleanValue(); |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
185 |
} catch (IOException x) { |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
186 |
Net.translateToSocketException(x); |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
187 |
return false; // Never happens |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
188 |
} |
2 | 189 |
} |
190 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
191 |
@Override |
2 | 192 |
public String toString() { |
193 |
if (!isBound()) |
|
194 |
return "ServerSocket[unbound]"; |
|
195 |
return "ServerSocket[addr=" + getInetAddress() + |
|
48761 | 196 |
",localport=" + getLocalPort() + "]"; |
2 | 197 |
} |
198 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
199 |
@Override |
2 | 200 |
public void setReceiveBufferSize(int size) throws SocketException { |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
201 |
// size 0 valid for ServerSocketChannel, invalid for ServerSocket |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
202 |
if (size <= 0) |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
203 |
throw new IllegalArgumentException("size cannot be 0 or negative"); |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
204 |
try { |
9679
d98ae8bc45fc
7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents:
7668
diff
changeset
|
205 |
ssc.setOption(StandardSocketOptions.SO_RCVBUF, size); |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
206 |
} catch (IOException x) { |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
207 |
Net.translateToSocketException(x); |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
208 |
} |
2 | 209 |
} |
210 |
||
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
211 |
@Override |
2 | 212 |
public int getReceiveBufferSize() throws SocketException { |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
213 |
try { |
9679
d98ae8bc45fc
7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents:
7668
diff
changeset
|
214 |
return ssc.getOption(StandardSocketOptions.SO_RCVBUF).intValue(); |
1152
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
215 |
} catch (IOException x) { |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
216 |
Net.translateToSocketException(x); |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
217 |
return -1; // Never happens |
29d6145d1097
4640544: New I/O: Complete socket-channel functionality
alanb
parents:
2
diff
changeset
|
218 |
} |
2 | 219 |
} |
54620
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
220 |
|
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
221 |
@Override |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
222 |
public <T> ServerSocket setOption(SocketOption<T> name, T value) throws IOException { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
223 |
ssc.setOption(name, value); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
224 |
return this; |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
225 |
} |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
226 |
|
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
227 |
@Override |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
228 |
public <T> T getOption(SocketOption<T> name) throws IOException { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
229 |
return ssc.getOption(name); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
230 |
} |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
231 |
|
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
232 |
@Override |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
233 |
public Set<SocketOption<?>> supportedOptions() { |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
234 |
return ssc.supportedOptions(); |
13b67c1420b8
8222774: (ch) Replace uses of stateLock and blockingLock with j.u.c. locks
alanb
parents:
49001
diff
changeset
|
235 |
} |
2 | 236 |
} |