2002-09-30 Michael Koch <konqueror@gmx.de>

* 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
This commit is contained in:
Michael Koch 2002-10-03 11:23:33 +00:00 committed by Michael Koch
parent 3eacc81d00
commit e832ab3c91
7 changed files with 596 additions and 120 deletions

View file

@ -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
{