From 07515641a55ffacad7a289e32702831f54630d07 Mon Sep 17 00:00:00 2001 From: Warren Levy Date: Fri, 28 May 1999 19:29:53 +0000 Subject: DatagramSocket.java (laddr): Removed. * java/net/DatagramSocket.java (laddr): Removed. (DatagramSocket): Removed attempts to get or set laddr if null. (getLocalAddress): Reimplemented per spec. * java/net/MulticastSocket.java (setTimeToLive): Throw exception when ttl is 0. (joinGroup): Throw NullPointerException if any argument is null. (leaveGroup): ditto. * java/net/PlainDatagramSocketImpl.java: Updated comments. * java/net/PlainSocketImpl.java (timeout): Added. (getInputStream): Added FIXME comment on how to support timeouts for TCP. * java/net/ServerSocket.java (ServerSocket): Added FIXME comment. * java/net/Socket.java: Added FIXME comments to identify conflicting specs between the JCL and JDK 1.2 documents. * java/net/natPlainDatagramSocketImpl.cc (bind): Use INADDR_ANY if host is null. Get localport value resolved by kernel if bind lport is 0. (receive): Implemented support for timeouts in UDP. (setOption): Implemented based on natPlainSocketImpl version. (getOption): ditto. * java/net/natPlainSocketImpl.cc (bind): Get localport value resolved by kernel if bind lport is 0. (connect): Get localport value resolved by kernel if bind wasn't done to set localport. (accept): Implemented support for timeouts for ServerSocket. (setOption): Save value for SO_TIMEOUT. (getOption): Return timeout for SO_TIMEOUT. From-SVN: r27230 --- libjava/java/net/Socket.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libjava/java/net/Socket.java') diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java index e4ef2d7eb88..db46db18e45 100644 --- a/libjava/java/net/Socket.java +++ b/libjava/java/net/Socket.java @@ -42,6 +42,9 @@ public class Socket if (s != null) s.checkConnect(host, port); impl.create(true); + // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port, + // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as + // that default. JDK 1.2 doc infers not to do a bind. impl.connect(host, port); } @@ -53,6 +56,9 @@ public class Socket if (s != null) s.checkConnect(address.getHostName(), port); impl.create(true); + // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port, + // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as + // that default. JDK 1.2 doc infers not to do a bind. impl.connect(address, port); } @@ -64,6 +70,7 @@ public class Socket if (s != null) s.checkConnect(host, port); impl.create(true); + // FIXME: JCL p. 1587 says if localAddr is null, use getLocalAddress(). impl.bind(localAddr, localPort); impl.connect(host, port); } @@ -76,6 +83,7 @@ public class Socket if (s != null) s.checkConnect(address.getHostName(), port); impl.create(true); + // FIXME: JCL p. 1587 says if localAddr is null, use getLocalAddress(). impl.bind(localAddr, localPort); impl.connect(address, port); } @@ -91,6 +99,9 @@ public class Socket SecurityManager s = System.getSecurityManager(); if (s != null) s.checkConnect(host, port); + // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port, + // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as + // that default. JDK 1.2 doc infers not to do a bind. impl.connect(host, port); } @@ -105,6 +116,9 @@ public class Socket SecurityManager s = System.getSecurityManager(); if (s != null) s.checkConnect(host.getHostName(), port); + // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port, + // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as + // that default. JDK 1.2 doc infers not to do a bind. impl.connect(host, port); } -- cgit v1.2.1