aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/MulticastSocket.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2002-09-04 17:35:22 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2002-09-04 17:35:22 +0000
commit7b98d4549b34d8fe57170ce9fb57f2c1508516dc (patch)
tree8bb320d92038cae1714858799816e7404ad258f4 /libjava/java/net/MulticastSocket.java
parent77e8a0cc9d87c7bbdebdd5eb92c0a356d6ed59ea (diff)
downloadgcc-7b98d4549b34d8fe57170ce9fb57f2c1508516dc.zip
gcc-7b98d4549b34d8fe57170ce9fb57f2c1508516dc.tar.gz
gcc-7b98d4549b34d8fe57170ce9fb57f2c1508516dc.tar.bz2
2002-09-04 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java (DatagramSocket): Added documentation. (close): Likewise. (getLocalAddress): Likewise. (getLocalPort): Likewise. (receive): Likewise. (send): Likewise. (setSoTimeout): Likewise. (connect): New method. (disconnect): New method. (getInetAddress): New method (FIXME) (getPort): New method. (setReuseAddress): New method. (getReuseAddress): New method. (setBroadcast): New method. (getBroadcast): New method. (setTrafficClass): New method. (getTrafficClass): New method. * java/net/MulticastSocket.java): (getTTL): Added @see in documentation. (setTTL): Added @see in documentation. (setLoopbackMode): New method. (getLoopbackMode): New method. * java/net/PlainSocketImpl.java: Added new constants for the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS * java/net/PlainDatagramSocketImpl.java Added new constants for the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS * java/net/natPlainSocketImpl.cc (getOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS (setOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS This should also fix SO_KEEPALIVE * java/net/natPlainDatagramSocketImpl.cc (getOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS (setOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS From-SVN: r56801
Diffstat (limited to 'libjava/java/net/MulticastSocket.java')
-rw-r--r--libjava/java/net/MulticastSocket.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java
index 54ed5c1..88cb149 100644
--- a/libjava/java/net/MulticastSocket.java
+++ b/libjava/java/net/MulticastSocket.java
@@ -114,6 +114,8 @@ public class MulticastSocket extends DatagramSocket
* @exception IOException If an error occurs
*
* @deprecated 1.2 Replaced by getTimeToLive()
+ *
+ * @see Multicastsocket:getTimeToLive
*/
public byte getTTL() throws IOException
{
@@ -151,6 +153,42 @@ public class MulticastSocket extends DatagramSocket
}
/**
+ * Disable/Enable local loopback of multicast packets. The option is used by
+ * the platform's networking code as a hint for setting whether multicast
+ * data will be looped back to the local socket.
+ *
+ * Because this option is a hint, applications that want to verify what
+ * loopback mode is set to should call #getLoopbackMode
+ *
+ * @param disable True to disable loopback mode
+ *
+ * @exception SocketException If an error occurs
+ *
+ * @since 1.4
+ */
+ public void setLoopbackMode(boolean disable) throws SocketException
+ {
+ impl.setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable));
+ }
+
+ /**
+ * Checks if local loopback mode is enabled or not
+ *
+ * @exception SocketException If an error occurs
+ *
+ * @since 1.4
+ */
+ public boolean getLoopbackMode() throws SocketException
+ {
+ Object obj = impl.getOption (SocketOptions.IP_MULTICAST_LOOP);
+
+ if (obj instanceof Boolean)
+ return ((Boolean) obj).booleanValue ();
+ else
+ throw new SocketException ("Unexpected type");
+ }
+
+ /**
* Sets the "Time to Live" value for a socket. The value must be between
* 1 and 255.
*
@@ -159,6 +197,8 @@ public class MulticastSocket extends DatagramSocket
* @exception IOException If an error occurs
*
* @deprecated 1.2 Replaced by <code>setTimeToLive</code>
+ *
+ * @see MulticastSocket:setTimeToLive
*/
public void setTTL(byte ttl) throws IOException
{