The java.nio.channels.DatagramChannel.send() method throws AlreadyConnectedException instead of IllegalArgumentException

Prior to Java 11, the java.nio.channels.DatagramChannel.send(ByteBuffer,SocketAddress) method would throw an java.lang.IllegalArgumentException when the DatagramChannel object was connected to a different address than the argument passed to the send method.

For more information on the java.nio.channels.DatagramChannel class, see java.nio.channels.DatagramChannel.

For more information on Java SE 11 changes, see Removed APIs in JDK 11.