diff options
author | Michael Koch <konqueror@gmx.de> | 2002-10-03 14:30:48 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2002-10-03 14:30:48 +0000 |
commit | a8e8f5c359b655106f4d59afc99315d0bb420040 (patch) | |
tree | 083ec10ee6e31b213f92a088bb5e803da3668318 | |
parent | 4c9c9a3da5efd5ae740201250428f7a48a263ac7 (diff) | |
download | gcc-a8e8f5c359b655106f4d59afc99315d0bb420040.zip gcc-a8e8f5c359b655106f4d59afc99315d0bb420040.tar.gz gcc-a8e8f5c359b655106f4d59afc99315d0bb420040.tar.bz2 |
2002-10-03 Michael Koch <konqueror@gmx.de>
* java/net/DatagramPacket.java
(setLength): Fixed typo and be HTML-aware.
* java/net/InetSocketAddress.java
(InetSocketAddress): Correct initialization of hostname, fixed typo.
(equals): Added comment about equality of InetSocketAddress objects.
* java/net/ServerSocket.java
(accept): Added checks.
(isClosed): New stubbed method.
* java/net/SocketOptions.java: Reindention.
* java/net/SocketPermission
(SocketPermission): Documentation fixed.
From-SVN: r57776
-rw-r--r-- | libjava/ChangeLog | 16 | ||||
-rw-r--r-- | libjava/java/net/DatagramPacket.java | 4 | ||||
-rw-r--r-- | libjava/java/net/InetSocketAddress.java | 15 | ||||
-rw-r--r-- | libjava/java/net/ServerSocket.java | 18 | ||||
-rw-r--r-- | libjava/java/net/SocketOptions.java | 10 | ||||
-rw-r--r-- | libjava/java/net/SocketPermission.java | 2 |
6 files changed, 46 insertions, 19 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4e7110f..61b0915 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,4 +1,18 @@ -2002-09-30 Michael Koch <konqueror@gmx.de> +2002-10-03 Michael Koch <konqueror@gmx.de> + + * java/net/DatagramPacket.java + (setLength): Fixed typo and be HTML-aware. + * java/net/InetSocketAddress.java + (InetSocketAddress): Correct initialization of hostname, fixed typo. + (equals): Added comment about equality of InetSocketAddress objects. + * java/net/ServerSocket.java + (accept): Added checks. + (isClosed): New stubbed method. + * java/net/SocketOptions.java: Reindention. + * java/net/SocketPermission + (SocketPermission): Documentation fixed. + +2002-10-03 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, diff --git a/libjava/java/net/DatagramPacket.java b/libjava/java/net/DatagramPacket.java index 7fbb3f8..7ca6c51 100644 --- a/libjava/java/net/DatagramPacket.java +++ b/libjava/java/net/DatagramPacket.java @@ -402,9 +402,9 @@ public final class DatagramPacket /** * Sets the length of the data in the buffer. * - * @param length The new length. (Where len <= buf.length) + * @param length The new length. (Where len <= buf.length) * - * @exception IllegalArgumentException f the length is negative or + * @exception IllegalArgumentException If the length is negative or * if the length is greater than the packet's data buffer length * * @since 1.1 diff --git a/libjava/java/net/InetSocketAddress.java b/libjava/java/net/InetSocketAddress.java index 1f932a9..1b740dc 100644 --- a/libjava/java/net/InetSocketAddress.java +++ b/libjava/java/net/InetSocketAddress.java @@ -57,7 +57,7 @@ public class InetSocketAddress extends SocketAddress * @param addr Address of the socket * @param port Port if the socket * - * @exception IllegalArgumentException If the port number is illegal + * @exception IllegalArgumentException If the port number is illegel */ public InetSocketAddress(InetAddress addr, int port) throws IllegalArgumentException @@ -67,15 +67,7 @@ public class InetSocketAddress extends SocketAddress this.addr = addr; this.port = port; - - try - { - this.hostname = addr.getHostName (); - } - catch (UnknownHostException e) - { - this.hostname = ""; - } + this.hostname = addr.getHostName (); } /** @@ -140,6 +132,9 @@ public class InetSocketAddress extends SocketAddress */ public final boolean equals (Object obj) { + // InetSocketAddress objects are equal when addr and port are equal. + // The hostname may differ. + if (obj instanceof InetSocketAddress) { InetSocketAddress a = (InetSocketAddress) obj; diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java index 36f93e8..b7c6991 100644 --- a/libjava/java/net/ServerSocket.java +++ b/libjava/java/net/ServerSocket.java @@ -287,6 +287,13 @@ public class ServerSocket */ public Socket accept () throws IOException { + if (impl == null) + throw new IOException ("Cannot initialize Socket implementation"); + + SecurityManager sm = System.getSecurityManager (); + if (sm != null) + sm.checkListen (impl.getLocalPort ()); + Socket s = new Socket(); implAccept (s); @@ -359,6 +366,17 @@ public class ServerSocket } /** + * Returns true if the socket is closed, otherwise false + * + * @since 1.4 + */ + public boolean isClosed() + { + // FIXME: implement this + return false; + } + + /** * Sets the value of SO_TIMEOUT. A value of 0 implies that SO_TIMEOUT is * disabled (ie, operations never time out). This is the number of * milliseconds a socket operation can block before an diff --git a/libjava/java/net/SocketOptions.java b/libjava/java/net/SocketOptions.java index 628e08e..f62afef 100644 --- a/libjava/java/net/SocketOptions.java +++ b/libjava/java/net/SocketOptions.java @@ -60,7 +60,7 @@ public interface SocketOptions * @since 1.3 */ static final int SO_KEEPALIVE = 0x8; - + /** * Option id for the SO_LINGER value */ @@ -106,13 +106,13 @@ public interface SocketOptions static final int SO_OOBINLINE = 0x1003; // 4099 /** - * Option id for the TCP_NODELAY value - */ + * Option id for the TCP_NODELAY value + */ static final int TCP_NODELAY = 0x01; // 1 /** - * Options id for the IP_MULTICAST_IF value - */ + * Options id for the IP_MULTICAST_IF value + */ static final int IP_MULTICAST_IF = 0x10; // 16 /** diff --git a/libjava/java/net/SocketPermission.java b/libjava/java/net/SocketPermission.java index 061ec9c..0f41395 100644 --- a/libjava/java/net/SocketPermission.java +++ b/libjava/java/net/SocketPermission.java @@ -121,7 +121,7 @@ public final class SocketPermission extends Permission * specified host/port combination and actions string. * * @param hostport The hostname/port number combination - * @param perms The actions string + * @param actions The actions string */ public SocketPermission(String hostport, String actions) { |