equal
deleted
inserted
replaced
661 ensureOpen(); |
661 ensureOpen(); |
662 if (localAddress != null) |
662 if (localAddress != null) |
663 throw new AlreadyBoundException(); |
663 throw new AlreadyBoundException(); |
664 InetSocketAddress isa; |
664 InetSocketAddress isa; |
665 if (local == null) { |
665 if (local == null) { |
666 isa = new InetSocketAddress(0); |
666 // only Inet4Address allowed with IPv4 socket |
|
667 if (family == StandardProtocolFamily.INET) { |
|
668 isa = new InetSocketAddress(InetAddress.getByName("0.0.0.0"), 0); |
|
669 } else { |
|
670 isa = new InetSocketAddress(0); |
|
671 } |
667 } else { |
672 } else { |
668 isa = Net.checkAddress(local); |
673 isa = Net.checkAddress(local); |
669 |
674 |
670 // only Inet4Address allowed with IPv4 socket |
675 // only Inet4Address allowed with IPv4 socket |
671 if (family == StandardProtocolFamily.INET) { |
676 if (family == StandardProtocolFamily.INET) { |