Package jnr.unixsocket
Class UnixDatagramChannel
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,MulticastChannel
,NetworkChannel
,ReadableByteChannel
,ScatteringByteChannel
,WritableByteChannel
,jnr.enxio.channels.NativeSelectableChannel
public class UnixDatagramChannel extends AbstractNativeDatagramChannel
-
-
Method Summary
-
Methods inherited from class jnr.unixsocket.impl.AbstractNativeDatagramChannel
getFD, implCloseSelectableChannel, implConfigureBlocking, read, setFD
-
Methods inherited from class java.nio.channels.DatagramChannel
open, read, validOps, write
-
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
-
Methods inherited from class java.nio.channels.SelectableChannel
register
-
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.nio.channels.MulticastChannel
close
-
-
-
-
Method Detail
-
open
public static final UnixDatagramChannel open() throws IOException
- Throws:
IOException
-
open
public static final UnixDatagramChannel open(jnr.constants.platform.ProtocolFamily domain, int protocol) throws IOException
- Throws:
IOException
-
pair
public static final UnixDatagramChannel[] pair() throws IOException
- Throws:
IOException
-
bind
public UnixDatagramChannel bind(SocketAddress local) throws IOException
- Specified by:
bind
in interfaceNetworkChannel
- Specified by:
bind
in classDatagramChannel
- Throws:
IOException
-
connect
public UnixDatagramChannel connect(UnixSocketAddress remote)
-
disconnect
public UnixDatagramChannel disconnect() throws IOException
- Specified by:
disconnect
in classDatagramChannel
- Throws:
IOException
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in classDatagramChannel
-
getRemoteSocketAddress
public final UnixSocketAddress getRemoteSocketAddress()
-
getLocalSocketAddress
public final UnixSocketAddress getLocalSocketAddress()
-
receive
public UnixSocketAddress receive(ByteBuffer src) throws IOException
- Specified by:
receive
in classDatagramChannel
- Throws:
IOException
-
send
public int send(ByteBuffer src, SocketAddress target) throws IOException
- Specified by:
send
in classDatagramChannel
- Throws:
IOException
-
connect
public DatagramChannel connect(SocketAddress remote) throws IOException
- Specified by:
connect
in classDatagramChannel
- Throws:
IOException
-
socket
public UnixDatagramSocket socket()
- Specified by:
socket
in classDatagramChannel
-
write
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
- Specified by:
write
in interfaceGatheringByteChannel
- Overrides:
write
in classAbstractNativeDatagramChannel
- Throws:
IOException
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
read
in interfaceReadableByteChannel
- Overrides:
read
in classAbstractNativeDatagramChannel
- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
write
in interfaceWritableByteChannel
- Overrides:
write
in classAbstractNativeDatagramChannel
- Throws:
IOException
-
getRemoteAddress
public SocketAddress getRemoteAddress() throws IOException
- Specified by:
getRemoteAddress
in classDatagramChannel
- Throws:
IOException
-
getLocalAddress
public SocketAddress getLocalAddress() throws IOException
- Specified by:
getLocalAddress
in interfaceNetworkChannel
- Specified by:
getLocalAddress
in classDatagramChannel
- Throws:
IOException
-
supportedOptions
public final Set<SocketOption<?>> supportedOptions()
-
getOption
public <T> T getOption(SocketOption<T> name) throws IOException
- Throws:
IOException
-
setOption
public <T> DatagramChannel setOption(SocketOption<T> name, T value) throws IOException
- Specified by:
setOption
in interfaceNetworkChannel
- Specified by:
setOption
in classDatagramChannel
- Throws:
IOException
-
join
public MembershipKey join(InetAddress group, NetworkInterface interf)
-
join
public MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source)
-
-