Java java.nio.channels DatagramChannel fields, constructors, methods, implement or subclass

Example usage for Java java.nio.channels DatagramChannel fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.nio.channels DatagramChannel.

The text is from its open source code.

Method

DatagramChannelbind(SocketAddress local)
voidclose()
Closes this channel.
SelectableChannelconfigureBlocking(boolean block)
Adjusts this channel's blocking mode.
DatagramChannelconnect(SocketAddress remote)
Connects this channel's socket.
SocketAddressgetLocalAddress()

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.

TgetOption(SocketOption name)
Returns the value of a socket option.
SocketAddressgetRemoteAddress()
Returns the remote address to which this channel's socket is connected.
booleanisConnected()
Tells whether or not this channel's socket is connected.
booleanisOpen()
MembershipKeyjoin(InetAddress group, NetworkInterface interf)
Joins a multicast group to begin receiving all datagrams sent to the group, returning a membership key.
SelectionKeykeyFor(Selector sel)
DatagramChannelopen()
Opens a datagram channel.
DatagramChannelopen(ProtocolFamily family)
Opens a datagram channel.
intread(ByteBuffer dst)
Reads a datagram from this channel.
longread(ByteBuffer[] dsts)
Reads a datagram from this channel.
SocketAddressreceive(ByteBuffer dst)
Receives a datagram via this channel.
SelectionKeyregister(Selector sel, int ops)
Registers this channel with the given selector, returning a selection key.
SelectionKeyregister(Selector sel, int ops, Object att)
Registers this channel with the given selector, returning a selection key.
intsend(ByteBuffer src, SocketAddress target)
Sends a datagram via this channel.
DatagramChannelsetOption(SocketOption name, T value)
DatagramSocketsocket()
Retrieves a datagram socket associated with this channel.
intvalidOps()
Returns an operation set identifying this channel's supported operations.
intwrite(ByteBuffer src)
Writes a datagram to this channel.
longwrite(ByteBuffer[] srcs)
Writes a datagram to this channel.