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:
bindin interfaceNetworkChannel- Specified by:
bindin classDatagramChannel- Throws:
IOException
-
connect
public UnixDatagramChannel connect(UnixSocketAddress remote)
-
disconnect
public UnixDatagramChannel disconnect() throws IOException
- Specified by:
disconnectin classDatagramChannel- Throws:
IOException
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin classDatagramChannel
-
getRemoteSocketAddress
public final UnixSocketAddress getRemoteSocketAddress()
-
getLocalSocketAddress
public final UnixSocketAddress getLocalSocketAddress()
-
receive
public UnixSocketAddress receive(ByteBuffer src) throws IOException
- Specified by:
receivein classDatagramChannel- Throws:
IOException
-
send
public int send(ByteBuffer src, SocketAddress target) throws IOException
- Specified by:
sendin classDatagramChannel- Throws:
IOException
-
connect
public DatagramChannel connect(SocketAddress remote) throws IOException
- Specified by:
connectin classDatagramChannel- Throws:
IOException
-
socket
public UnixDatagramSocket socket()
- Specified by:
socketin classDatagramChannel
-
write
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
- Specified by:
writein interfaceGatheringByteChannel- Overrides:
writein classAbstractNativeDatagramChannel- Throws:
IOException
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
readin interfaceReadableByteChannel- Overrides:
readin classAbstractNativeDatagramChannel- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
writein interfaceWritableByteChannel- Overrides:
writein classAbstractNativeDatagramChannel- Throws:
IOException
-
getRemoteAddress
public SocketAddress getRemoteAddress() throws IOException
- Specified by:
getRemoteAddressin classDatagramChannel- Throws:
IOException
-
getLocalAddress
public SocketAddress getLocalAddress() throws IOException
- Specified by:
getLocalAddressin interfaceNetworkChannel- Specified by:
getLocalAddressin 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:
setOptionin interfaceNetworkChannel- Specified by:
setOptionin classDatagramChannel- Throws:
IOException
-
join
public MembershipKey join(InetAddress group, NetworkInterface interf)
-
join
public MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source)
-
-