mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8224477: java.net socket types new-style socket option methods - spec and impl mismatch
Reviewed-by: alanb
This commit is contained in:
parent
cf48689855
commit
bc24d17e80
18 changed files with 1289 additions and 300 deletions
|
@ -1025,6 +1025,9 @@ class ServerSocket implements java.io.Closeable {
|
|||
public <T> ServerSocket setOption(SocketOption<T> name, T value)
|
||||
throws IOException
|
||||
{
|
||||
Objects.requireNonNull(name);
|
||||
if (isClosed())
|
||||
throw new SocketException("Socket is closed");
|
||||
getImpl().setOption(name, value);
|
||||
return this;
|
||||
}
|
||||
|
@ -1053,6 +1056,9 @@ class ServerSocket implements java.io.Closeable {
|
|||
* @since 9
|
||||
*/
|
||||
public <T> T getOption(SocketOption<T> name) throws IOException {
|
||||
Objects.requireNonNull(name);
|
||||
if (isClosed())
|
||||
throw new SocketException("Socket is closed");
|
||||
return getImpl().getOption(name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue