From e832ab3c91f01cdb1bd618ffe4a8e00505264d22 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Thu, 3 Oct 2002 11:23:33 +0000 Subject: 2002-09-30 Michael Koch * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772 --- libjava/java/net/MulticastSocket.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'libjava/java/net/MulticastSocket.java') diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java index b358260..04d0735 100644 --- a/libjava/java/net/MulticastSocket.java +++ b/libjava/java/net/MulticastSocket.java @@ -252,7 +252,8 @@ public class MulticastSocket extends DatagramSocket * @param addr The address of the group to join * * @exception IOException If an error occurs - * @exception SecurityException FIXME + * @exception SecurityException If a security manager exists and its + * checkMulticast method doesn't allow the operation */ public void joinGroup(InetAddress mcastaddr) throws IOException { @@ -272,7 +273,8 @@ public class MulticastSocket extends DatagramSocket * @param addr The address of the group to leave * * @exception IOException If an error occurs - * @exception SecurityException FIXME + * @exception SecurityException If a security manager exists and its + * checkMulticast method doesn't allow the operation */ public void leaveGroup(InetAddress mcastaddr) throws IOException { @@ -296,7 +298,8 @@ public class MulticastSocket extends DatagramSocket * * @exception IOException If an error occurs * @exception IllegalArgumentException If address type is not supported - * @exception SecurityException FIXME + * @exception SecurityException If a security manager exists and its + * checkMulticast method doesn't allow the operation * * @see MulticastSocket:setInterface * @see MulticastSocket:setNetworkInterface @@ -314,7 +317,6 @@ public class MulticastSocket extends DatagramSocket if (! tmp.getAddress ().isMulticastAddress ()) throw new IOException ("Not a Multicast address"); - // FIXME: check if this check is sufficient. Do we need to check the port ? SecurityManager s = System.getSecurityManager (); if (s != null) s.checkMulticast (tmp.getAddress ()); @@ -331,7 +333,8 @@ public class MulticastSocket extends DatagramSocket * * @exception IOException If an error occurs * @exception IllegalArgumentException If address type is not supported - * @exception SecurityException FIXME + * @exception SecurityException If a security manager exists and its + * checkMulticast method doesn't allow the operation * * @see MulticastSocket:setInterface * @see MulticastSocket:setNetworkInterface @@ -346,7 +349,6 @@ public class MulticastSocket extends DatagramSocket if (! tmp.getAddress ().isMulticastAddress ()) throw new IOException ("Not a Multicast address"); - // FIXME: do we need to check the port too, or is this sufficient ? SecurityManager s = System.getSecurityManager (); if (s != null) s.checkMulticast (tmp.getAddress ()); @@ -363,7 +365,8 @@ public class MulticastSocket extends DatagramSocket * @param ttl The TTL for this packet * * @exception IOException If an error occurs - * @exception SecurityException FIXME + * @exception SecurityException If a security manager exists and its + * checkConnect or checkMulticast method doesn't allow the operation */ public synchronized void send(DatagramPacket p, byte ttl) throws IOException { -- cgit v1.1