mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8198753: (dc) DatagramChannel throws unspecified exceptions
Reviewed-by: alanb
This commit is contained in:
parent
9aff9cb645
commit
37f1b2b1e3
7 changed files with 217 additions and 75 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2018, 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
|
||||
|
@ -279,6 +279,9 @@ public abstract class DatagramChannel
|
|||
*
|
||||
* @return This datagram channel
|
||||
*
|
||||
* @throws AlreadyConnectedException
|
||||
* If this channel is already connected
|
||||
*
|
||||
* @throws ClosedChannelException
|
||||
* If this channel is closed
|
||||
*
|
||||
|
@ -292,6 +295,12 @@ public abstract class DatagramChannel
|
|||
* closing the channel and setting the current thread's
|
||||
* interrupt status
|
||||
*
|
||||
* @throws UnresolvedAddressException
|
||||
* If the given remote address is not fully resolved
|
||||
*
|
||||
* @throws UnsupportedAddressTypeException
|
||||
* If the type of the given remote address is not supported
|
||||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed
|
||||
* and it does not permit access to the given remote address
|
||||
|
@ -444,6 +453,10 @@ public abstract class DatagramChannel
|
|||
* zero if there was insufficient room for the datagram in the
|
||||
* underlying output buffer
|
||||
*
|
||||
* @throws AlreadyConnectedException
|
||||
* If this channel is connected to a different address
|
||||
* from that specified by {@code target}
|
||||
*
|
||||
* @throws ClosedChannelException
|
||||
* If this channel is closed
|
||||
*
|
||||
|
@ -457,6 +470,12 @@ public abstract class DatagramChannel
|
|||
* closing the channel and setting the current thread's
|
||||
* interrupt status
|
||||
*
|
||||
* @throws UnresolvedAddressException
|
||||
* If the given remote address is not fully resolved
|
||||
*
|
||||
* @throws UnsupportedAddressTypeException
|
||||
* If the type of the given remote address is not supported
|
||||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed
|
||||
* and it does not permit datagrams to be sent
|
||||
|
|
|
@ -508,8 +508,7 @@ class DatagramChannelImpl
|
|||
if (remote != null) {
|
||||
// connected
|
||||
if (!target.equals(remote)) {
|
||||
throw new IllegalArgumentException(
|
||||
"Connected address not equal to target address");
|
||||
throw new AlreadyConnectedException();
|
||||
}
|
||||
do {
|
||||
n = IOUtil.write(fd, src, -1, nd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue