< prev index next >
src/java.base/share/classes/java/net/DatagramSocket.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
*** 186,198 ****
* <p>If there is a security manager,
* its {@code checkListen} method is first called
* with 0 as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
! * @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @exception SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
*/
public DatagramSocket() throws SocketException {
--- 186,198 ----
* <p>If there is a security manager,
* its {@code checkListen} method is first called
* with 0 as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
! * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
*/
public DatagramSocket() throws SocketException {
*** 227,239 ****
* This could result in a SecurityException.
*
* @param bindaddr local socket address to bind, or {@code null}
* for an unbound socket.
*
! * @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @exception SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
* @since 1.4
*/
--- 227,239 ----
* This could result in a SecurityException.
*
* @param bindaddr local socket address to bind, or {@code null}
* for an unbound socket.
*
! * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
* @since 1.4
*/
*** 261,273 ****
* with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param port port to use.
! * @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @exception SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
*/
public DatagramSocket(int port) throws SocketException {
--- 261,273 ----
* with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param port port to use.
! * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
*/
public DatagramSocket(int port) throws SocketException {
*** 288,300 ****
* This could result in a SecurityException.
*
* @param port local port to use
* @param laddr local address to bind
*
! * @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @exception SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
* @since 1.1
*/
--- 288,300 ----
* This could result in a SecurityException.
*
* @param port local port to use
* @param laddr local address to bind
*
! * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
! * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
* @since 1.1
*/
*** 633,653 ****
* {@code p.getPort()}. Each call to a security manager method
* could result in a SecurityException if the operation is not allowed.
*
* @param p the {@code DatagramPacket} to be sent.
*
! * @exception IOException if an I/O error occurs.
! * @exception SecurityException if a security manager exists and its
* {@code checkMulticast} or {@code checkConnect}
* method doesn't allow the send.
! * @exception PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no
* guarantee that the exception will be thrown.
! * @exception java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode.
! * @exception IllegalArgumentException if the socket is connected,
* and connected address and packet address differ.
*
* @see java.net.DatagramPacket
* @see SecurityManager#checkMulticast(InetAddress)
* @see SecurityManager#checkConnect
--- 633,653 ----
* {@code p.getPort()}. Each call to a security manager method
* could result in a SecurityException if the operation is not allowed.
*
* @param p the {@code DatagramPacket} to be sent.
*
! * @throws IOException if an I/O error occurs.
! * @throws SecurityException if a security manager exists and its
* {@code checkMulticast} or {@code checkConnect}
* method doesn't allow the send.
! * @throws PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no
* guarantee that the exception will be thrown.
! * @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode.
! * @throws IllegalArgumentException if the socket is connected,
* and connected address and packet address differ.
*
* @see java.net.DatagramPacket
* @see SecurityManager#checkMulticast(InetAddress)
* @see SecurityManager#checkConnect
*** 712,728 ****
* security manager's {@code checkAccept} method
* does not allow it.
*
* @param p the {@code DatagramPacket} into which to place
* the incoming data.
! * @exception IOException if an I/O error occurs.
! * @exception SocketTimeoutException if setSoTimeout was previously called
* and the timeout has expired.
! * @exception PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no guarantee that the
* exception will be thrown.
! * @exception java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode.
* @see java.net.DatagramPacket
* @see java.net.DatagramSocket
* @revised 1.4
--- 712,728 ----
* security manager's {@code checkAccept} method
* does not allow it.
*
* @param p the {@code DatagramPacket} into which to place
* the incoming data.
! * @throws IOException if an I/O error occurs.
! * @throws SocketTimeoutException if setSoTimeout was previously called
* and the timeout has expired.
! * @throws PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no guarantee that the
* exception will be thrown.
! * @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode.
* @see java.net.DatagramPacket
* @see java.net.DatagramSocket
* @revised 1.4
*** 949,961 ****
* packet is sent or discarded.
*
* @param size the size to which to set the send buffer
* size. This value must be greater than 0.
*
! * @exception SocketException if there is an error
* in the underlying protocol, such as an UDP error.
! * @exception IllegalArgumentException if the value is 0 or is
* negative.
* @see #getSendBufferSize()
*/
public synchronized void setSendBufferSize(int size)
throws SocketException{
--- 949,961 ----
* packet is sent or discarded.
*
* @param size the size to which to set the send buffer
* size. This value must be greater than 0.
*
! * @throws SocketException if there is an error
* in the underlying protocol, such as an UDP error.
! * @throws IllegalArgumentException if the value is 0 or is
* negative.
* @see #getSendBufferSize()
*/
public synchronized void setSendBufferSize(int size)
throws SocketException{
*** 970,980 ****
/**
* Get value of the SO_SNDBUF option for this {@code DatagramSocket}, that is the
* buffer size used by the platform for output on this {@code DatagramSocket}.
*
* @return the value of the SO_SNDBUF option for this {@code DatagramSocket}
! * @exception SocketException if there is an error in
* the underlying protocol, such as an UDP error.
* @see #setSendBufferSize
*/
public synchronized int getSendBufferSize() throws SocketException {
if (isClosed())
--- 970,980 ----
/**
* Get value of the SO_SNDBUF option for this {@code DatagramSocket}, that is the
* buffer size used by the platform for output on this {@code DatagramSocket}.
*
* @return the value of the SO_SNDBUF option for this {@code DatagramSocket}
! * @throws SocketException if there is an error in
* the underlying protocol, such as an UDP error.
* @see #setSendBufferSize
*/
public synchronized int getSendBufferSize() throws SocketException {
if (isClosed())
*** 1007,1019 ****
* than SO_RCVBUF can be received.
*
* @param size the size to which to set the receive buffer
* size. This value must be greater than 0.
*
! * @exception SocketException if there is an error in
* the underlying protocol, such as an UDP error.
! * @exception IllegalArgumentException if the value is 0 or is
* negative.
* @see #getReceiveBufferSize()
*/
public synchronized void setReceiveBufferSize(int size)
throws SocketException{
--- 1007,1019 ----
* than SO_RCVBUF can be received.
*
* @param size the size to which to set the receive buffer
* size. This value must be greater than 0.
*
! * @throws SocketException if there is an error in
* the underlying protocol, such as an UDP error.
! * @throws IllegalArgumentException if the value is 0 or is
* negative.
* @see #getReceiveBufferSize()
*/
public synchronized void setReceiveBufferSize(int size)
throws SocketException{
*** 1028,1038 ****
/**
* Get value of the SO_RCVBUF option for this {@code DatagramSocket}, that is the
* buffer size used by the platform for input on this {@code DatagramSocket}.
*
* @return the value of the SO_RCVBUF option for this {@code DatagramSocket}
! * @exception SocketException if there is an error in the underlying protocol, such as an UDP error.
* @see #setReceiveBufferSize(int)
*/
public synchronized int getReceiveBufferSize()
throws SocketException{
if (isClosed())
--- 1028,1038 ----
/**
* Get value of the SO_RCVBUF option for this {@code DatagramSocket}, that is the
* buffer size used by the platform for input on this {@code DatagramSocket}.
*
* @return the value of the SO_RCVBUF option for this {@code DatagramSocket}
! * @throws SocketException if there is an error in the underlying protocol, such as an UDP error.
* @see #setReceiveBufferSize(int)
*/
public synchronized int getReceiveBufferSize()
throws SocketException{
if (isClosed())
*** 1068,1078 ****
* The behaviour when {@code SO_REUSEADDR} is enabled or
* disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the
! * @exception SocketException if an error occurs enabling or
* disabling the {@code SO_REUSEADDR} socket option,
* or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
--- 1068,1078 ----
* The behaviour when {@code SO_REUSEADDR} is enabled or
* disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the
! * @throws SocketException if an error occurs enabling or
* disabling the {@code SO_REUSEADDR} socket option,
* or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
*** 1091,1101 ****
/**
* Tests if SO_REUSEADDR is enabled.
*
* @return a {@code boolean} indicating whether or not SO_REUSEADDR is enabled.
! * @exception SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
* @see #setReuseAddress(boolean)
*/
public synchronized boolean getReuseAddress() throws SocketException {
--- 1091,1101 ----
/**
* Tests if SO_REUSEADDR is enabled.
*
* @return a {@code boolean} indicating whether or not SO_REUSEADDR is enabled.
! * @throws SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
* @see #setReuseAddress(boolean)
*/
public synchronized boolean getReuseAddress() throws SocketException {
*** 1129,1139 ****
}
/**
* Tests if SO_BROADCAST is enabled.
* @return a {@code boolean} indicating whether or not SO_BROADCAST is enabled.
! * @exception SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
* @see #setBroadcast(boolean)
*/
public synchronized boolean getBroadcast() throws SocketException {
--- 1129,1139 ----
}
/**
* Tests if SO_BROADCAST is enabled.
* @return a {@code boolean} indicating whether or not SO_BROADCAST is enabled.
! * @throws SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
* @see #setBroadcast(boolean)
*/
public synchronized boolean getBroadcast() throws SocketException {
*** 1288,1301 ****
* the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
! * @exception IOException if an I/O error occurs when setting the
* datagram socket factory.
! * @exception SocketException if the factory is already defined.
! * @exception SecurityException if a security manager exists and its
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.DatagramSocketImplFactory#createDatagramSocketImpl()
* @see SecurityManager#checkSetFactory
* @since 1.3
*/
--- 1288,1301 ----
* the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
! * @throws IOException if an I/O error occurs when setting the
* datagram socket factory.
! * @throws SocketException if the factory is already defined.
! * @throws SecurityException if a security manager exists and its
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.DatagramSocketImplFactory#createDatagramSocketImpl()
* @see SecurityManager#checkSetFactory
* @since 1.3
*/
< prev index next >