Skip to content
Permalink
Browse files
8255604: java/nio/channels/DatagramChannel/Connect.java fails with ja…
…va.net.BindException: Cannot assign requested address: connect

Backport-of: d5138d1
  • Loading branch information
GoeLin committed Apr 1, 2022
1 parent 4a045a7 commit 164febe
Showing 1 changed file with 1 addition and 1 deletion.
@@ -133,7 +133,7 @@ public static class Reactor implements AutoCloseable, Runnable {
final DatagramChannel dc;

Reactor() throws IOException {
dc = DatagramChannel.open().bind(new InetSocketAddress(0));
dc = DatagramChannel.open().bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
}

SocketAddress getSocketAddress() throws IOException {

1 comment on commit 164febe

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.