+2003-06-08 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (DatagramSocket): No need to set SO_REUSEADDRESS here. This belongs
+ into the Multicast constructors.
+ * java/net/DatagramSocketImpl.java
+ (getOption): Removed.
+ (setOption): Removed.
+ * java/net/MulticastSocket.java
+ (MulticastSocket): Call setReuseAddress (true).
+ * java/net/SocketImpl.java
+ (getOption): Removed.
+ (setOption): Removed.
+
2003-06-07 Jeff Sturm <jsturm@one-point.com>
PR libgcj/10886:
}
impl.create();
- // For multicasting, set the socket to be reused (Stevens pp. 195-6).
- if (this instanceof MulticastSocket)
- impl.setOption(SocketOptions.SO_REUSEADDR, new Boolean(true));
impl.bind(port, laddr == null ? InetAddress.ANY_IF : laddr);
*/
public int getLocalPort()
{
- if (!isBound ())
- return -1;
-
return impl.getLocalPort();
}
{
return localPort;
}
-
- /**
- * Sets the specified option on a socket to the passed in object. For
- * options that take an integer argument, the passed in object is an
- * <code>Integer</code>. For options that are set to on or off, the
- * value passed will be a <code>Boolean</code>. The <code>optionId</code>
- * parameter is one of the defined constants in the superinterface.
- *
- * @param optionId The identifier of the option
- * @param val The value to set the option to
- *
- * @exception SocketException If an error occurs
- * @XXX This redeclaration from SocketOptions is a workaround to a gcj bug.
- */
- public abstract void setOption(int optionId, Object val)
- throws SocketException;
-
- /**
- * Returns the current setting of the specified option. The
- * <code>Object</code> returned will be an <code>Integer</code> for options
- * that have integer values. For options that are set to on or off, a
- * <code>Boolean</code> will be returned. The <code>optionId</code>
- * is one of the defined constants in the superinterface.
- *
- * @param optionId The option identifier
- *
- * @return The current value of the option
- *
- * @exception SocketException If an error occurs
- * @XXX This redeclaration from SocketOptions is a workaround to a gcj bug.
- */
- public abstract Object getOption(int option_id) throws SocketException;
}
public MulticastSocket() throws IOException
{
super(0, null);
+ setReuseAddress (true);
}
/**
public MulticastSocket(int port) throws IOException
{
super(port, null);
+ setReuseAddress (true);
}
/**
public MulticastSocket(SocketAddress address) throws IOException
{
super(address);
+ setReuseAddress (true);
}
/**
+ ",localport=" + localport + "]";
}
- /**
- * Sets the specified option on a socket to the passed in object. For
- * options that take an integer argument, the passed in object is an
- * <code>Integer</code>. For options that are set to on or off, the
- * value passed will be a <code>Boolean</code>. The <code>option_id</code>
- * parameter is one of the defined constants in the superinterface.
- *
- * @param option_id The identifier of the option
- * @param val The value to set the option to
- *
- * @exception SocketException If an error occurs
- * @XXX This redeclaration from SocketOptions is a workaround to a gcj bug.
- */
- public abstract void setOption(int option_id, Object val)
- throws SocketException;
-
- /**
- * Returns the current setting of the specified option. The
- * <code>Object</code> returned will be an <code>Integer</code> for options
- * that have integer values. For options that are set to on or off, a
- * <code>Boolean</code> will be returned. The <code>option_id</code>
- * is one of the defined constants in the superinterface.
- *
- * @param option_id The option identifier
- *
- * @return The current value of the option
- *
- * @exception SocketException If an error occurs
- * @XXX This redeclaration from SocketOptions is a workaround to a gcj bug.
- */
- public abstract Object getOption(int option_id) throws SocketException;
-
/**
* Shut down the input side of this socket. Subsequent reads will
* return end-of-file.