java.nio.channels
public abstract class DatagramChannel extends AbstractSelectableChannel implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
Since: 1.4
Constructor Summary | |
---|---|
protected | DatagramChannel(SelectorProvider provider)
Initializes the channel. |
Method Summary | |
---|---|
abstract DatagramChannel | connect(SocketAddress remote)
Connects this channel's socket.
|
abstract DatagramChannel | disconnect()
Disonnects this channel's socket.
|
abstract boolean | isConnected()
Tells whether or not this channel's socket is connected.
|
static DatagramChannel | open()
Opens a datagram channel.
|
long | read(ByteBuffer[] dsts)
Reads data from this channel. |
abstract int | read(ByteBuffer dst)
Reads data from this channel. |
abstract long | read(ByteBuffer[] dsts, int offset, int length)
Reads data from this channel.
|
abstract SocketAddress | receive(ByteBuffer dst)
Receives a datagram via this channel.
|
abstract int | send(ByteBuffer src, SocketAddress target)
Sends a datagram via this channel.
|
abstract DatagramSocket | socket()
Retrieves the channel's socket. |
int | validOps()
Retrieves the valid operations for this channel.
|
long | write(ByteBuffer[] srcs)
Writes data to this channel.
|
abstract int | write(ByteBuffer src)
Writes data to this channel.
|
abstract long | write(ByteBuffer[] srcs, int offset, int length)
Writes data to this channel.
|
Throws: AsynchronousCloseException If another thread closes this channel while the connect operation is in progress. ClosedByInterruptException If another thread interrupts the current thread while the read operation is in progress, thereby closing the channel and setting the current thread's interrupt status. ClosedChannelException If this channel is closed. IOException If an error occurs. SecurityException If a security manager has been installed and it does not permit datagrams to be sent to the given address.
Throws: IOException If an error occurs
Throws: NotYetConnectedException The channel's socket is not connected.
Throws: IOException If an error occurs
Throws: IOException If an error occurs. NotYetConnectedException The channel's socket is not connected.
Throws: AsynchronousCloseException If another thread closes this channel while the connect operation is in progress. ClosedByInterruptException If another thread interrupts the current thread while the read operation is in progress, thereby closing the channel and setting the current thread's interrupt status. ClosedChannelException If this channel is closed. IOException If an error occurs SecurityException If a security manager has been installed and it does not permit datagrams to be sent to the given address.
Throws: AsynchronousCloseException If another thread closes this channel while the connect operation is in progress. ClosedByInterruptException If another thread interrupts the current thread while the read operation is in progress, thereby closing the channel and setting the current thread's interrupt status. ClosedChannelException If this channel is closed. IOException If an error occurs SecurityException If a security manager has been installed and it does not permit datagrams to be sent to the given address.
Throws: NotYetConnectedException The channel's socket is not connected.
Throws: IOException If an error occurs NotYetConnectedException The channel's socket is not connected.
Throws: IOException If an error occurs. NotYetConnectedException The channel's socket is not connected.
Throws: IOException If an error occurs. NotYetConnectedException The channel's socket is not connected.