DatagramPacket
includes information indicating the data to be sent, its length, the IP address of the remote host, and the port number on the remote host. If there is a security manager, and the socket is not currently connected to a remote address, this method first performs some security checks. First, if p.getAddress().isMulticastAddress()
is true, this method calls the security manager's checkMulticast
method with p.getAddress()
as its argument. If the evaluation of that expression is false, this method instead calls the security manager's checkConnect
method with arguments p.getAddress().getHostAddress()
and p.getPort()
. Each call to a security manager method could result in a SecurityException if the operation is not allowed.
@param p the DatagramPacket
to be sent.
@exception IOException if an I/O error occurs.
@exception SecurityException if a security manager exists and its checkMulticast
or checkConnect
method doesn't allow the send.
@exception PortUnreachableException may be thrown if the socket is connectedto 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 SecurityManager#checkMulticast(InetAddress)
@see SecurityManager#checkConnect
@revised 1.4
@spec JSR-51
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|