| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final BindHandler | |
| private UnixSocketAddress | |
| private UnixSocketAddress | |
| private UnixDatagramChannel. | |
| private final ReadWriteLock |
| Access | Constructor and Description |
|---|---|
| private | |
| pack-priv | |
| pack-priv | |
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public UnixDatagramChannel | bind(SocketAddress
The address to bind the socket, or local)null to bind the socket
to an automatically assigned socket addressImplements abstract java. Implements java. |
| public UnixDatagramChannel | |
| public DatagramChannel | connect(SocketAddress
The remote address to which this channel is to be connected remote)Implements abstract java. |
| public UnixDatagramChannel | disconnect()
Implements abstract java. |
| public SocketAddress | getLocalAddress()
Implements abstract java. Implements java. |
| public final UnixSocketAddress | |
| public <T> T | getOption(SocketOption<T>
The socket option name)Implements java. |
| public SocketAddress | getRemoteAddress()
Implements abstract java. |
| public final UnixSocketAddress | |
| pack-priv boolean | |
| public boolean | isConnected()
Implements abstract java. |
| public MembershipKey | join(InetAddress
The multicast address to join group, NetworkInterface The network interface on which to join the group interf)Implements java. |
| public MembershipKey | join(InetAddress
The multicast address to join group, NetworkInterface The network interface on which to join the group interf, InetAddress The source address source)Implements java. |
| public static final UnixDatagramChannel | |
| public static final UnixDatagramChannel | |
| public static final UnixDatagramChannel[] | |
| public int | read(ByteBuffer
The buffer into which bytes are to be transferred dst)Overrides jnr. Implements java. |
| public UnixSocketAddress | receive(ByteBuffer
The buffer into which the datagram is to be transferred src)Implements abstract java. |
| public int | send(ByteBuffer
The buffer containing the datagram to be sent src, SocketAddress The address to which the datagram is to be sent target)Implements abstract java. |
| public <T> DatagramChannel | setOption(SocketOption<T>
The socket option name, T The value of the socket option. A value of value)null may be
a valid value for some socket options.Implements abstract java. Implements java. |
| public UnixDatagramSocket | socket()
Implements abstract java. |
| public final Set | supportedOptions()
Implements java. |
| public long | write(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than offset, int srcs.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)srcs.length - offsetOverrides jnr. Implements java. |
| public int | write(ByteBuffer
The buffer from which bytes are to be retrieved src)Overrides jnr. Implements java. |
| bindHandler | back to summary |
|---|---|
| private final BindHandler bindHandler | |
| localAddress | back to summary |
|---|---|
| private UnixSocketAddress localAddress | |
| remoteAddress | back to summary |
|---|---|
| private UnixSocketAddress remoteAddress | |
| state | back to summary |
|---|---|
| private UnixDatagramChannel. | |
| stateLock | back to summary |
|---|---|
| private final ReadWriteLock stateLock | |
| UnixDatagramChannel | back to summary |
|---|---|
| private UnixDatagramChannel() throws IOException | |
| UnixDatagramChannel | back to summary |
|---|---|
| pack-priv UnixDatagramChannel(ProtocolFamily domain, int protocol) throws IOException | |
| UnixDatagramChannel | back to summary |
|---|---|
| pack-priv UnixDatagramChannel(int fd) | |
| UnixDatagramChannel | back to summary |
|---|---|
| pack-priv UnixDatagramChannel(int fd, UnixDatagramChannel. | |
| UnixDatagramChannel | back to summary |
|---|---|
| pack-priv UnixDatagramChannel(int fd, UnixSocketAddress remote) throws IOException | |
| bind | back to summary |
|---|---|
| public UnixDatagramChannel bind(SocketAddress local) throws IOException Implements abstract java. Implements java. Doc from java. Binds the channel's socket to a local address. This method is used to establish an association between the socket and
a local address. Once an association is established then the socket remains
bound until the channel is closed. If the
| |
| connect | back to summary |
|---|---|
| public UnixDatagramChannel connect(UnixSocketAddress remote) | |
| connect | back to summary |
|---|---|
| public DatagramChannel connect(SocketAddress remote) throws IOException Implements abstract java. Doc from java. Connects this channel's socket. The channel's socket is configured so that it only receives datagrams from, and sends datagrams to, the given remote peer address. Once connected, datagrams may not be received from or sent to any other address. Datagrams in the channel's socket receive buffer, which have not been received before invoking this method, may be discarded. The channel's socket remains connected until it is explicitly disconnected or until it is closed. This method performs exactly the same security checks as the This method may be invoked at any time. If another thread has
already initiated a read or write operation upon this channel, then an
invocation of this method will block until any such operation is
complete. If this channel's socket is not bound then this method will
first cause the socket to be bound to an address that is assigned
automatically, as if invoking the
| |
| disconnect | back to summary |
|---|---|
| public UnixDatagramChannel disconnect() throws IOException Implements abstract java. Doc from java. Disconnects this channel's socket. The channel's socket is configured so that it can receive datagrams from, and sends datagrams to, any remote address so long as the security manager, if installed, permits it. This method may be invoked at any time. If another thread has already initiated a read or write operation upon this channel, then an invocation of this method will block until any such operation is complete. If this channel's socket is not connected, or if the channel is closed, then invoking this method has no effect.
| |
| getLocalAddress | back to summary |
|---|---|
| public SocketAddress getLocalAddress() throws IOException Implements abstract java. Implements java. Doc from java. Returns the socket address that this channel's socket is bound to. Where the channel is
If the channel's socket was initially bound to the wildcard address and
is now
If there is a security manager set, its
| |
| getLocalSocketAddress | back to summary |
|---|---|
| public final UnixSocketAddress getLocalSocketAddress() | |
| getOption | back to summary |
|---|---|
| public <T> T getOption(SocketOption<T> name) throws IOException Implements java. Doc from java. Returns the value of a socket option.
| |
| getRemoteAddress | back to summary |
|---|---|
| public SocketAddress getRemoteAddress() throws IOException Implements abstract java. Doc from java. Returns the remote address to which this channel's socket is connected.
| |
| getRemoteSocketAddress | back to summary |
|---|---|
| public final UnixSocketAddress getRemoteSocketAddress() | |
| isBound | back to summary |
|---|---|
| pack-priv boolean isBound() | |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() Implements abstract java. Doc from java. Tells whether or not this channel's socket is connected.
| |
| join | back to summary |
|---|---|
| public MembershipKey join(InetAddress group, NetworkInterface interf) Implements java. Doc from java. Joins a multicast group to begin receiving all datagrams sent to the group, returning a membership key. If this channel is currently a member of the group on the given
interface to receive all datagrams then the membership key, representing
that membership, is returned. Otherwise this channel joins the group and
the resulting new membership key is returned. The resulting membership key
is not A multicast channel may join several multicast groups, including the same group on more than one interface. An implementation may impose a limit on the number of groups that may be joined at the same time.
| |
| join | back to summary |
|---|---|
| public MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source) Implements java. Doc from java. Joins a multicast group to begin receiving datagrams sent to the group from a given source address. If this channel is currently a member of the group on the given
interface to receive datagrams from the given source address then the
membership key, representing that membership, is returned. Otherwise this
channel joins the group and the resulting new membership key is returned.
The resulting membership key is Membership is cumulative and this method may be invoked again with the same group and interface to allow receiving datagrams sent by other source addresses to the group.
| |
| open | back to summary |
|---|---|
| public static final UnixDatagramChannel open() throws IOException Hides java. Doc from java. Opens a datagram channel. The new channel is created by invoking the The
| |
| open | back to summary |
|---|---|
| public static final UnixDatagramChannel open(ProtocolFamily domain, int protocol) throws IOException | |
| pair | back to summary |
|---|---|
| public static final UnixDatagramChannel[] pair() throws IOException | |
| read | back to summary |
|---|---|
| public int read(ByteBuffer dst) throws IOException Overrides jnr. Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffer. An attempt is made to read up to r bytes from the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is read, where
A read operation might not fill the buffer, and in fact it might not read any bytes at all. Whether or not it does so depends upon the nature and state of the channel. A socket channel in non-blocking mode, for example, cannot read any more bytes than are immediately available from the socket's input buffer; similarly, a file channel cannot read any more bytes than remain in the file. It is guaranteed, however, that if a channel is in blocking mode and there is at least one byte remaining in the buffer then this method will block until at least one byte is read. This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| receive | back to summary |
|---|---|
| public UnixSocketAddress receive(ByteBuffer src) throws IOException Implements abstract java. Doc from java. Receives a datagram via this channel. If a datagram is immediately available, or if this channel is in
blocking mode and one eventually becomes available, then the datagram is
copied into the given byte buffer and its source address is returned.
If this channel is in non-blocking mode and a datagram is not
immediately available then this method immediately returns
The datagram is transferred into the given byte buffer starting at
its current position, as if by a regular This method performs exactly the same security checks as the This method may be invoked at any time. If another thread has
already initiated a read operation upon this channel, however, then an
invocation of this method will block until the first operation is
complete. If this channel's socket is not bound then this method will
first cause the socket to be bound to an address that is assigned
automatically, as if invoking the
| |
| send | back to summary |
|---|---|
| public int send(ByteBuffer src, SocketAddress target) throws IOException Implements abstract java. Doc from java. Sends a datagram via this channel. If this channel is in non-blocking mode and there is sufficient room in the underlying output buffer, or if this channel is in blocking mode and sufficient room becomes available, then the remaining bytes in the given buffer are transmitted as a single datagram to the given target address. The datagram is transferred from the byte buffer as if by a regular
This method performs exactly the same security checks as the This method may be invoked at any time. If another thread has
already initiated a write operation upon this channel, however, then an
invocation of this method will block until the first operation is
complete. If this channel's socket is not bound then this method will
first cause the socket to be bound to an address that is assigned
automatically, as if by invoking the
| |
| setOption | back to summary |
|---|---|
| public <T> DatagramChannel setOption(SocketOption<T> name, T value) throws IOException Implements abstract java. Implements java. Doc from java. Sets the value of a socket option.
| |
| socket | back to summary |
|---|---|
| public UnixDatagramSocket socket() Implements abstract java. Doc from java. Retrieves a datagram socket associated with this channel.
| |
| supportedOptions | back to summary |
|---|---|
| public final Set Implements java. Doc from java. Returns a set of the socket options supported by this channel. This method will continue to return the set of options even after the channel has been closed.
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs, int offset, int length) throws IOException Overrides jnr. Implements java. Doc from java. Writes a datagram to this channel. This method may only be invoked if this channel's socket is
connected, in which case it sends datagrams directly to the socket's
peer. Otherwise it behaves exactly as specified in the
| |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Overrides jnr. Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. An attempt is made to write up to r bytes to the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Set |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static Set |
| defaultOptions | back to summary |
|---|---|
| pack-priv static final Set<SocketOption<?>> defaultOptions | |
| DefaultOptionsHolder | back to summary |
|---|---|
| private DefaultOptionsHolder() | |
| defaultOptions | back to summary |
|---|---|
| private static Set | |
| Modifier and Type | Field and Description |
|---|---|
| public static final UnixDatagramChannel. | |
| public static final UnixDatagramChannel. | |
| public static final UnixDatagramChannel. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static UnixDatagramChannel. | |
| public static UnixDatagramChannel. |
| CONNECTED | back to summary |
|---|---|
| public static final UnixDatagramChannel. | |
| IDLE | back to summary |
|---|---|
| public static final UnixDatagramChannel. | |
| UNINITIALIZED | back to summary |
|---|---|
| public static final UnixDatagramChannel. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static UnixDatagramChannel. | |
| values | back to summary |
|---|---|
| public static UnixDatagramChannel. | |