< prev index next >

src/java.base/share/classes/java/net/MulticastSocket.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

*** 1,7 **** /* ! * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 101,113 **** * <p> * When the socket is created the * {@link DatagramSocket#setReuseAddress(boolean)} method is called to * enable the SO_REUSEADDR socket option. * ! * @exception IOException if an I/O exception occurs while creating the * MulticastSocket ! * @exception SecurityException if a security manager exists and its * {@code checkListen} method doesn't allow the operation. * @see SecurityManager#checkListen * @see java.net.DatagramSocket#setReuseAddress(boolean) * @see java.net.DatagramSocketImpl#setOption(SocketOption, Object) */ --- 101,113 ---- * <p> * When the socket is created the * {@link DatagramSocket#setReuseAddress(boolean)} method is called to * enable the SO_REUSEADDR socket option. * ! * @throws IOException if an I/O exception occurs while creating the * MulticastSocket ! * @throws SecurityException if a security manager exists and its * {@code checkListen} method doesn't allow the operation. * @see SecurityManager#checkListen * @see java.net.DatagramSocket#setReuseAddress(boolean) * @see java.net.DatagramSocketImpl#setOption(SocketOption, Object) */
*** 127,139 **** * When the socket is created the * {@link DatagramSocket#setReuseAddress(boolean)} method is * called to enable the SO_REUSEADDR socket option. * * @param port port to use ! * @exception IOException if an I/O exception occurs * while creating the MulticastSocket ! * @exception SecurityException if a security manager exists and its * {@code checkListen} method doesn't allow the operation. * @see SecurityManager#checkListen * @see java.net.DatagramSocket#setReuseAddress(boolean) */ public MulticastSocket(int port) throws IOException { --- 127,139 ---- * When the socket is created the * {@link DatagramSocket#setReuseAddress(boolean)} method is * called to enable the SO_REUSEADDR socket option. * * @param port port to use ! * @throws IOException if an I/O exception occurs * while creating the MulticastSocket ! * @throws SecurityException if a security manager exists and its * {@code checkListen} method doesn't allow the operation. * @see SecurityManager#checkListen * @see java.net.DatagramSocket#setReuseAddress(boolean) */ public MulticastSocket(int port) throws IOException {
*** 154,166 **** * {@link DatagramSocket#setReuseAddress(boolean)} method is * called to enable the SO_REUSEADDR socket option. * * @param bindaddr Socket address to bind to, or {@code null} for * an unbound socket. ! * @exception IOException if an I/O exception occurs * while creating the MulticastSocket ! * @exception SecurityException if a security manager exists and its * {@code checkListen} method doesn't allow the operation. * @see SecurityManager#checkListen * @see java.net.DatagramSocket#setReuseAddress(boolean) * * @since 1.4 --- 154,166 ---- * {@link DatagramSocket#setReuseAddress(boolean)} method is * called to enable the SO_REUSEADDR socket option. * * @param bindaddr Socket address to bind to, or {@code null} for * an unbound socket. ! * @throws IOException if an I/O exception occurs * while creating the MulticastSocket ! * @throws SecurityException if a security manager exists and its * {@code checkListen} method doesn't allow the operation. * @see SecurityManager#checkListen * @see java.net.DatagramSocket#setReuseAddress(boolean) * * @since 1.4
*** 207,217 **** * * <p>The ttl is an <b>unsigned</b> 8-bit quantity, and so <B>must</B> be * in the range {@code 0 <= ttl <= 0xFF }. * * @param ttl the time-to-live ! * @exception IOException if an I/O exception occurs * while setting the default time-to-live value * @deprecated use the setTimeToLive method instead, which uses * <b>int</b> instead of <b>byte</b> as the type for ttl. * @see #getTTL() */ --- 207,217 ---- * * <p>The ttl is an <b>unsigned</b> 8-bit quantity, and so <B>must</B> be * in the range {@code 0 <= ttl <= 0xFF }. * * @param ttl the time-to-live ! * @throws IOException if an I/O exception occurs * while setting the default time-to-live value * @deprecated use the setTimeToLive method instead, which uses * <b>int</b> instead of <b>byte</b> as the type for ttl. * @see #getTTL() */
*** 252,262 **** /** * Get the default time-to-live for multicast packets sent out on * the socket. * ! * @exception IOException if an I/O exception occurs * while getting the default time-to-live value * @return the default time-to-live value * @deprecated use the getTimeToLive method instead, which returns * an <b>int</b> instead of a <b>byte</b>. * @see #setTTL(byte) --- 252,262 ---- /** * Get the default time-to-live for multicast packets sent out on * the socket. * ! * @throws IOException if an I/O exception occurs * while getting the default time-to-live value * @return the default time-to-live value * @deprecated use the getTimeToLive method instead, which returns * an <b>int</b> instead of a <b>byte</b>. * @see #setTTL(byte)
*** 269,279 **** } /** * Get the default time-to-live for multicast packets sent out on * the socket. ! * @exception IOException if an I/O exception occurs while * getting the default time-to-live value * @return the default time-to-live value * @see #setTimeToLive(int) */ public int getTimeToLive() throws IOException { --- 269,279 ---- } /** * Get the default time-to-live for multicast packets sent out on * the socket. ! * @throws IOException if an I/O exception occurs while * getting the default time-to-live value * @return the default time-to-live value * @see #setTimeToLive(int) */ public int getTimeToLive() throws IOException {
*** 291,304 **** * with the {@code mcastaddr} argument * as its argument. * * @param mcastaddr is the multicast address to join * ! * @exception IOException if there is an error joining, or when the address * is not a multicast address, or the platform does not support * multicasting ! * @exception SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the join. * * @see SecurityManager#checkMulticast(InetAddress) */ public void joinGroup(InetAddress mcastaddr) throws IOException { --- 291,304 ---- * with the {@code mcastaddr} argument * as its argument. * * @param mcastaddr is the multicast address to join * ! * @throws IOException if there is an error joining, or when the address * is not a multicast address, or the platform does not support * multicasting ! * @throws SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the join. * * @see SecurityManager#checkMulticast(InetAddress) */ public void joinGroup(InetAddress mcastaddr) throws IOException {
*** 337,349 **** * calls its {@code checkMulticast} method * with the {@code mcastaddr} argument * as its argument. * * @param mcastaddr is the multicast address to leave ! * @exception IOException if there is an error leaving * or when the address is not a multicast address. ! * @exception SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the operation. * * @see SecurityManager#checkMulticast(InetAddress) */ public void leaveGroup(InetAddress mcastaddr) throws IOException { --- 337,349 ---- * calls its {@code checkMulticast} method * with the {@code mcastaddr} argument * as its argument. * * @param mcastaddr is the multicast address to leave ! * @throws IOException if there is an error leaving * or when the address is not a multicast address. ! * @throws SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the operation. * * @see SecurityManager#checkMulticast(InetAddress) */ public void leaveGroup(InetAddress mcastaddr) throws IOException {
*** 376,389 **** * @param netIf specifies the local interface to receive multicast * datagram packets, or <i>null</i> to defer to the interface set by * {@link MulticastSocket#setInterface(InetAddress)} or * {@link MulticastSocket#setNetworkInterface(NetworkInterface)} * ! * @exception IOException if there is an error joining, or when the address * is not a multicast address, or the platform does not support * multicasting ! * @exception SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the join. * @throws IllegalArgumentException if mcastaddr is null or is a * SocketAddress subclass not supported by this socket * * @see SecurityManager#checkMulticast(InetAddress) --- 376,389 ---- * @param netIf specifies the local interface to receive multicast * datagram packets, or <i>null</i> to defer to the interface set by * {@link MulticastSocket#setInterface(InetAddress)} or * {@link MulticastSocket#setNetworkInterface(NetworkInterface)} * ! * @throws IOException if there is an error joining, or when the address * is not a multicast address, or the platform does not support * multicasting ! * @throws SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the join. * @throws IllegalArgumentException if mcastaddr is null or is a * SocketAddress subclass not supported by this socket * * @see SecurityManager#checkMulticast(InetAddress)
*** 424,436 **** * @param mcastaddr is the multicast address to leave * @param netIf specifies the local interface or <i>null</i> to defer * to the interface set by * {@link MulticastSocket#setInterface(InetAddress)} or * {@link MulticastSocket#setNetworkInterface(NetworkInterface)} ! * @exception IOException if there is an error leaving * or when the address is not a multicast address. ! * @exception SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the operation. * @throws IllegalArgumentException if mcastaddr is null or is a * SocketAddress subclass not supported by this socket * * @see SecurityManager#checkMulticast(InetAddress) --- 424,436 ---- * @param mcastaddr is the multicast address to leave * @param netIf specifies the local interface or <i>null</i> to defer * to the interface set by * {@link MulticastSocket#setInterface(InetAddress)} or * {@link MulticastSocket#setNetworkInterface(NetworkInterface)} ! * @throws IOException if there is an error leaving * or when the address is not a multicast address. ! * @throws SecurityException if a security manager exists and its * {@code checkMulticast} method doesn't allow the operation. * @throws IllegalArgumentException if mcastaddr is null or is a * SocketAddress subclass not supported by this socket * * @see SecurityManager#checkMulticast(InetAddress)
*** 463,473 **** /** * Set the multicast network interface used by methods * whose behavior would be affected by the value of the * network interface. Useful for multihomed hosts. * @param inf the InetAddress ! * @exception SocketException if there is an error in * the underlying protocol, such as a TCP error. * @see #getInterface() */ public void setInterface(InetAddress inf) throws SocketException { if (isClosed()) { --- 463,473 ---- /** * Set the multicast network interface used by methods * whose behavior would be affected by the value of the * network interface. Useful for multihomed hosts. * @param inf the InetAddress ! * @throws SocketException if there is an error in * the underlying protocol, such as a TCP error. * @see #getInterface() */ public void setInterface(InetAddress inf) throws SocketException { if (isClosed()) {
*** 487,497 **** * * @return An {@code InetAddress} representing * the address of the network interface used for * multicast packets. * ! * @exception SocketException if there is an error in * the underlying protocol, such as a TCP error. * * @see #setInterface(java.net.InetAddress) */ public InetAddress getInterface() throws SocketException { --- 487,497 ---- * * @return An {@code InetAddress} representing * the address of the network interface used for * multicast packets. * ! * @throws SocketException if there is an error in * the underlying protocol, such as a TCP error. * * @see #setInterface(java.net.InetAddress) */ public InetAddress getInterface() throws SocketException {
*** 547,557 **** /** * Specify the network interface for outgoing multicast datagrams * sent on this socket. * * @param netIf the interface ! * @exception SocketException if there is an error in * the underlying protocol, such as a TCP error. * @see #getNetworkInterface() * @since 1.4 */ public void setNetworkInterface(NetworkInterface netIf) --- 547,557 ---- /** * Specify the network interface for outgoing multicast datagrams * sent on this socket. * * @param netIf the interface ! * @throws SocketException if there is an error in * the underlying protocol, such as a TCP error. * @see #getNetworkInterface() * @since 1.4 */ public void setNetworkInterface(NetworkInterface netIf)
*** 565,575 **** } /** * Get the multicast network interface set. * ! * @exception SocketException if there is an error in * the underlying protocol, such as a TCP error. * @return the multicast {@code NetworkInterface} currently set * @see #setNetworkInterface(NetworkInterface) * @since 1.4 */ --- 565,575 ---- } /** * Get the multicast network interface set. * ! * @throws SocketException if there is an error in * the underlying protocol, such as a TCP error. * @return the multicast {@code NetworkInterface} currently set * @see #setNetworkInterface(NetworkInterface) * @since 1.4 */
*** 641,653 **** * One does not need to be the member of the group to send * packets to a destination multicast address. * @param ttl optional time to live for multicast packet. * default ttl is 1. * ! * @exception IOException is raised if an error occurs i.e * error while setting ttl. ! * @exception SecurityException if a security manager exists and its * {@code checkMulticast} or {@code checkConnect} * method doesn't allow the send. * * @deprecated Use the following code or its equivalent instead: * ...... --- 641,653 ---- * One does not need to be the member of the group to send * packets to a destination multicast address. * @param ttl optional time to live for multicast packet. * default ttl is 1. * ! * @throws IOException is raised if an error occurs i.e * error while setting ttl. ! * @throws SecurityException if a security manager exists and its * {@code checkMulticast} or {@code checkConnect} * method doesn't allow the send. * * @deprecated Use the following code or its equivalent instead: * ......
< prev index next >