Connect the socket of this channel to a remote address, which is the only communication peer of getting and sending datagrams after connected.
This method can be called at any moment, and won't affect the processing read and write operation. The connect status won't changed before disconnected and closed.
This method just execute the same security checks as the connect method of the DatagramSocket
class.
@param address The address to be connected.
@return This channel.
@throws ClosedChannelException If the channel is already closed.
@throws AsynchronousCloseException If the channel is closed by another thread while this method is in operation.
@throws ClosedByInterruptException If another thread interrupts the calling thread while the operation is in progress. The calling thread will have the interrupt state set, and the channel will be closed.
@throws SecurityException If there is a security manager, and the address is not permitted to access.
@throws IOException Some other IO error occurred.