Example usage for Java java.nio.channels DatagramChannel fields, constructors, methods, implement or subclass
The text is from its open source code.
DatagramChannel | bind(SocketAddress local) |
void | close() Closes this channel. |
SelectableChannel | configureBlocking(boolean block) Adjusts this channel's blocking mode. |
DatagramChannel | connect(SocketAddress remote) Connects this channel's socket. |
SocketAddress | getLocalAddress() If there is a security manager set, its checkConnect method is called with the local address and -1 as its arguments to see if the operation is allowed. |
T | getOption(SocketOption Returns the value of a socket option. |
SocketAddress | getRemoteAddress() Returns the remote address to which this channel's socket is connected. |
boolean | isConnected() Tells whether or not this channel's socket is connected. |
boolean | isOpen() |
MembershipKey | join(InetAddress group, NetworkInterface interf) Joins a multicast group to begin receiving all datagrams sent to the group, returning a membership key. |
SelectionKey | keyFor(Selector sel) |
DatagramChannel | open() Opens a datagram channel. |
DatagramChannel | open(ProtocolFamily family) Opens a datagram channel. |
int | read(ByteBuffer dst) Reads a datagram from this channel. |
long | read(ByteBuffer[] dsts) Reads a datagram from this channel. |
SocketAddress | receive(ByteBuffer dst) Receives a datagram via this channel. |
SelectionKey | register(Selector sel, int ops) Registers this channel with the given selector, returning a selection key. |
SelectionKey | register(Selector sel, int ops, Object att) Registers this channel with the given selector, returning a selection key. |
int | send(ByteBuffer src, SocketAddress target) Sends a datagram via this channel. |
DatagramChannel | setOption(SocketOption |
DatagramSocket | socket() Retrieves a datagram socket associated with this channel. |
int | validOps() Returns an operation set identifying this channel's supported operations. |
int | write(ByteBuffer src) Writes a datagram to this channel. |
long | write(ByteBuffer[] srcs) Writes a datagram to this channel. |