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
This commit is contained in:
Warren Levy 1999-05-28 19:29:53 +00:00 committed by Warren Levy
parent 930248932e
commit 07515641a5
9 changed files with 332 additions and 59 deletions

View file

@ -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);
}