< prev index next >
src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java
Print this page
*** 24,33 ****
--- 24,34 ----
*/
package sun.nio.ch;
import java.io.IOException;
+ import java.io.UncheckedIOException;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.invoke.VarHandle;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
*** 104,114 ****
if (address == null)
throw new IllegalArgumentException("Address can't be null");
try {
connectInternal(new InetSocketAddress(address, port));
} catch (SocketException x) {
! throw new Error(x);
}
}
@Override
public void connect(SocketAddress remote) throws SocketException {
--- 105,115 ----
if (address == null)
throw new IllegalArgumentException("Address can't be null");
try {
connectInternal(new InetSocketAddress(address, port));
} catch (SocketException x) {
! throw new UncheckedIOException(x);
}
}
@Override
public void connect(SocketAddress remote) throws SocketException {
*** 120,130 ****
@Override
public void disconnect() {
try {
dc.disconnect();
} catch (IOException x) {
! throw new Error(x);
}
}
@Override
public boolean isBound() {
--- 121,131 ----
@Override
public void disconnect() {
try {
dc.disconnect();
} catch (IOException x) {
! throw new UncheckedIOException(x);
}
}
@Override
public boolean isBound() {
< prev index next >