summaryrefslogtreecommitdiffstats
path: root/luni/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'luni/src/main')
-rw-r--r--luni/src/main/java/java/net/DatagramSocket.java8
-rw-r--r--luni/src/main/java/java/net/InetSocketAddress.java2
-rw-r--r--luni/src/main/java/java/net/ServerSocket.java8
-rw-r--r--luni/src/main/java/java/net/Socket.java12
4 files changed, 15 insertions, 15 deletions
diff --git a/luni/src/main/java/java/net/DatagramSocket.java b/luni/src/main/java/java/net/DatagramSocket.java
index 01d3bed..3195240 100644
--- a/luni/src/main/java/java/net/DatagramSocket.java
+++ b/luni/src/main/java/java/net/DatagramSocket.java
@@ -77,7 +77,7 @@ public class DatagramSocket implements Closeable {
*/
public DatagramSocket(int aPort) throws SocketException {
checkPort(aPort);
- createSocket(aPort, Inet4Address.ANY);
+ createSocket(aPort, Inet6Address.ANY);
}
/**
@@ -94,7 +94,7 @@ public class DatagramSocket implements Closeable {
*/
public DatagramSocket(int aPort, InetAddress addr) throws SocketException {
checkPort(aPort);
- createSocket(aPort, (addr == null) ? Inet4Address.ANY : addr);
+ createSocket(aPort, (addr == null) ? Inet6Address.ANY : addr);
}
private void checkPort(int aPort) {
@@ -443,7 +443,7 @@ public class DatagramSocket implements Closeable {
private void ensureBound() throws SocketException {
if (!isBound()) {
- impl.bind(0, Inet4Address.ANY);
+ impl.bind(0, Inet6Address.ANY);
isBound = true;
}
}
@@ -467,7 +467,7 @@ public class DatagramSocket implements Closeable {
InetAddress addr;
if (localAddr == null) {
localPort = 0;
- addr = Inet4Address.ANY;
+ addr = Inet6Address.ANY;
} else {
if (!(localAddr instanceof InetSocketAddress)) {
throw new IllegalArgumentException("Local address not an InetSocketAddress: " +
diff --git a/luni/src/main/java/java/net/InetSocketAddress.java b/luni/src/main/java/java/net/InetSocketAddress.java
index f12c399..1b3eabe 100644
--- a/luni/src/main/java/java/net/InetSocketAddress.java
+++ b/luni/src/main/java/java/net/InetSocketAddress.java
@@ -67,7 +67,7 @@ public class InetSocketAddress extends SocketAddress {
if (port < 0 || port > 65535) {
throw new IllegalArgumentException("port=" + port);
}
- this.addr = (address == null) ? Inet4Address.ANY : address;
+ this.addr = (address == null) ? Inet6Address.ANY : address;
this.hostname = null;
this.port = port;
}
diff --git a/luni/src/main/java/java/net/ServerSocket.java b/luni/src/main/java/java/net/ServerSocket.java
index b1d59d5..a2cd9c6 100644
--- a/luni/src/main/java/java/net/ServerSocket.java
+++ b/luni/src/main/java/java/net/ServerSocket.java
@@ -72,7 +72,7 @@ public class ServerSocket implements Closeable {
* @throws IOException if an error occurs while creating the socket.
*/
public ServerSocket(int port) throws IOException {
- this(port, DEFAULT_BACKLOG, Inet4Address.ANY);
+ this(port, DEFAULT_BACKLOG, Inet6Address.ANY);
}
/**
@@ -83,7 +83,7 @@ public class ServerSocket implements Closeable {
* @throws IOException if an error occurs while creating the socket.
*/
public ServerSocket(int port, int backlog) throws IOException {
- this(port, backlog, Inet4Address.ANY);
+ this(port, backlog, Inet6Address.ANY);
}
/**
@@ -98,7 +98,7 @@ public class ServerSocket implements Closeable {
checkListen(port);
this.impl = factory != null ? factory.createSocketImpl()
: new PlainServerSocketImpl();
- InetAddress addr = (localAddress == null) ? Inet4Address.ANY : localAddress;
+ InetAddress addr = (localAddress == null) ? Inet6Address.ANY : localAddress;
synchronized (this) {
impl.create(true);
@@ -317,7 +317,7 @@ public class ServerSocket implements Closeable {
InetAddress addr;
int port;
if (localAddr == null) {
- addr = Inet4Address.ANY;
+ addr = Inet6Address.ANY;
port = 0;
} else {
if (!(localAddr instanceof InetSocketAddress)) {
diff --git a/luni/src/main/java/java/net/Socket.java b/luni/src/main/java/java/net/Socket.java
index 737b01b..7ee6b05 100644
--- a/luni/src/main/java/java/net/Socket.java
+++ b/luni/src/main/java/java/net/Socket.java
@@ -41,7 +41,7 @@ public class Socket implements Closeable {
private boolean isInputShutdown = false;
private boolean isOutputShutdown = false;
- private InetAddress localAddress = Inet4Address.ANY;
+ private InetAddress localAddress = Inet6Address.ANY;
private final Object connectLock = new Object();
@@ -317,7 +317,7 @@ public class Socket implements Closeable {
isConnected = false;
// RI compatibility: the RI returns the any address (but the original local port) after
// close.
- localAddress = Inet4Address.ANY;
+ localAddress = Inet6Address.ANY;
impl.close();
}
@@ -332,7 +332,7 @@ public class Socket implements Closeable {
isConnected = false;
// RI compatibility: the RI returns the any address (but the original local port) after
// close.
- localAddress = Inet4Address.ANY;
+ localAddress = Inet6Address.ANY;
impl.onClose();
}
@@ -579,7 +579,7 @@ public class Socket implements Closeable {
throw new IllegalArgumentException("Local port out of range: " + localPort);
}
- InetAddress addr = localAddress == null ? Inet4Address.ANY : localAddress;
+ InetAddress addr = localAddress == null ? Inet6Address.ANY : localAddress;
synchronized (this) {
impl.create(streaming);
isCreated = true;
@@ -774,7 +774,7 @@ public class Socket implements Closeable {
InetAddress addr;
if (localAddr == null) {
port = 0;
- addr = Inet4Address.ANY;
+ addr = Inet6Address.ANY;
} else {
if (!(localAddr instanceof InetSocketAddress)) {
throw new IllegalArgumentException("Local address not an InetSocketAddress: " +
@@ -877,7 +877,7 @@ public class Socket implements Closeable {
// options on create
// impl.create(true);
if (!usingSocks()) {
- impl.bind(Inet4Address.ANY, 0);
+ impl.bind(Inet6Address.ANY, 0);
}
isBound = true;
}