public class UnixDatagramChannel
extends jnr.enxio.channels.AbstractNativeDatagramChannel
| Modifier and Type | Class and Description |
|---|---|
private static class |
UnixDatagramChannel.DefaultOptionsHolder |
(package private) static class |
UnixDatagramChannel.State |
| Modifier and Type | Field and Description |
|---|---|
private BindHandler |
bindHandler |
private UnixSocketAddress |
localAddress |
private UnixSocketAddress |
remoteAddress |
private UnixDatagramChannel.State |
state |
private java.util.concurrent.locks.ReadWriteLock |
stateLock |
| Modifier | Constructor and Description |
|---|---|
private |
UnixDatagramChannel() |
(package private) |
UnixDatagramChannel(int fd) |
(package private) |
UnixDatagramChannel(int fd,
UnixDatagramChannel.State initialState,
boolean initialBoundState) |
(package private) |
UnixDatagramChannel(int fd,
UnixSocketAddress remote) |
| Modifier and Type | Method and Description |
|---|---|
UnixDatagramChannel |
bind(java.net.SocketAddress local) |
java.nio.channels.DatagramChannel |
connect(java.net.SocketAddress remote) |
UnixDatagramChannel |
connect(UnixSocketAddress remote) |
UnixDatagramChannel |
disconnect() |
java.net.SocketAddress |
getLocalAddress() |
UnixSocketAddress |
getLocalSocketAddress() |
<T> T |
getOption(java.net.SocketOption<T> name) |
java.net.SocketAddress |
getRemoteAddress() |
UnixSocketAddress |
getRemoteSocketAddress() |
(package private) boolean |
isBound() |
boolean |
isConnected() |
java.nio.channels.MembershipKey |
join(java.net.InetAddress group,
java.net.NetworkInterface interf) |
java.nio.channels.MembershipKey |
join(java.net.InetAddress group,
java.net.NetworkInterface interf,
java.net.InetAddress source) |
static UnixDatagramChannel |
open() |
static UnixDatagramChannel[] |
pair() |
int |
read(java.nio.ByteBuffer dst) |
UnixSocketAddress |
receive(java.nio.ByteBuffer src) |
int |
send(java.nio.ByteBuffer src,
java.net.SocketAddress target) |
<T> java.nio.channels.DatagramChannel |
setOption(java.net.SocketOption<T> name,
T value) |
UnixDatagramSocket |
socket() |
java.util.Set<java.net.SocketOption<?>> |
supportedOptions() |
int |
write(java.nio.ByteBuffer src) |
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
getFD, implCloseSelectableChannel, implConfigureBlocking, read, setFDblockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerbegin, close, end, isOpenprivate UnixDatagramChannel.State state
private UnixSocketAddress remoteAddress
private UnixSocketAddress localAddress
private final java.util.concurrent.locks.ReadWriteLock stateLock
private final BindHandler bindHandler
private UnixDatagramChannel()
throws java.io.IOException
java.io.IOExceptionUnixDatagramChannel(int fd)
UnixDatagramChannel(int fd,
UnixDatagramChannel.State initialState,
boolean initialBoundState)
UnixDatagramChannel(int fd,
UnixSocketAddress remote)
throws java.io.IOException
java.io.IOExceptionpublic static final UnixDatagramChannel open() throws java.io.IOException
java.io.IOExceptionpublic static final UnixDatagramChannel[] pair() throws java.io.IOException
java.io.IOExceptionpublic UnixDatagramChannel bind(java.net.SocketAddress local) throws java.io.IOException
bind in interface java.nio.channels.NetworkChannelbind in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic UnixDatagramChannel connect(UnixSocketAddress remote)
public UnixDatagramChannel disconnect() throws java.io.IOException
disconnect in class java.nio.channels.DatagramChanneljava.io.IOExceptionboolean isBound()
public boolean isConnected()
isConnected in class java.nio.channels.DatagramChannelpublic final UnixSocketAddress getRemoteSocketAddress()
public final UnixSocketAddress getLocalSocketAddress()
public UnixSocketAddress receive(java.nio.ByteBuffer src) throws java.io.IOException
receive in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic int send(java.nio.ByteBuffer src,
java.net.SocketAddress target)
throws java.io.IOException
send in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic java.nio.channels.DatagramChannel connect(java.net.SocketAddress remote)
throws java.io.IOException
connect in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic UnixDatagramSocket socket()
socket in class java.nio.channels.DatagramChannelpublic long write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
throws java.io.IOException
write in interface java.nio.channels.GatheringByteChannelwrite in class jnr.enxio.channels.AbstractNativeDatagramChanneljava.io.IOExceptionpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChannelread in class jnr.enxio.channels.AbstractNativeDatagramChanneljava.io.IOExceptionpublic int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChannelwrite in class jnr.enxio.channels.AbstractNativeDatagramChanneljava.io.IOExceptionpublic java.net.SocketAddress getRemoteAddress()
throws java.io.IOException
getRemoteAddress in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic java.net.SocketAddress getLocalAddress()
throws java.io.IOException
getLocalAddress in interface java.nio.channels.NetworkChannelgetLocalAddress in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic final java.util.Set<java.net.SocketOption<?>> supportedOptions()
public <T> T getOption(java.net.SocketOption<T> name)
throws java.io.IOException
java.io.IOExceptionpublic <T> java.nio.channels.DatagramChannel setOption(java.net.SocketOption<T> name,
T value)
throws java.io.IOException
setOption in interface java.nio.channels.NetworkChannelsetOption in class java.nio.channels.DatagramChanneljava.io.IOExceptionpublic java.nio.channels.MembershipKey join(java.net.InetAddress group,
java.net.NetworkInterface interf)
public java.nio.channels.MembershipKey join(java.net.InetAddress group,
java.net.NetworkInterface interf,
java.net.InetAddress source)