Package jnr.unixsocket
Class UnixDatagramChannel
- java.lang.Object
-
- java.nio.channels.spi.AbstractInterruptibleChannel
-
- java.nio.channels.SelectableChannel
-
- java.nio.channels.spi.AbstractSelectableChannel
-
- java.nio.channels.DatagramChannel
-
- jnr.unixsocket.impl.AbstractNativeDatagramChannel
-
- jnr.unixsocket.UnixDatagramChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.GatheringByteChannel,java.nio.channels.InterruptibleChannel,java.nio.channels.MulticastChannel,java.nio.channels.NetworkChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.ScatteringByteChannel,java.nio.channels.WritableByteChannel,jnr.enxio.channels.NativeSelectableChannel
public class UnixDatagramChannel extends AbstractNativeDatagramChannel
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UnixDatagramChannelbind(java.net.SocketAddress local)java.nio.channels.DatagramChannelconnect(java.net.SocketAddress remote)UnixDatagramChannelconnect(UnixSocketAddress remote)UnixDatagramChanneldisconnect()java.net.SocketAddressgetLocalAddress()UnixSocketAddressgetLocalSocketAddress()<T> TgetOption(java.net.SocketOption<T> name)java.net.SocketAddressgetRemoteAddress()UnixSocketAddressgetRemoteSocketAddress()booleanisConnected()java.nio.channels.MembershipKeyjoin(java.net.InetAddress group, java.net.NetworkInterface interf)java.nio.channels.MembershipKeyjoin(java.net.InetAddress group, java.net.NetworkInterface interf, java.net.InetAddress source)static UnixDatagramChannelopen()static UnixDatagramChannelopen(jnr.constants.platform.ProtocolFamily domain, int protocol)static UnixDatagramChannel[]pair()intread(java.nio.ByteBuffer dst)UnixSocketAddressreceive(java.nio.ByteBuffer src)intsend(java.nio.ByteBuffer src, java.net.SocketAddress target)<T> java.nio.channels.DatagramChannelsetOption(java.net.SocketOption<T> name, T value)UnixDatagramSocketsocket()java.util.Set<java.net.SocketOption<?>>supportedOptions()intwrite(java.nio.ByteBuffer src)longwrite(java.nio.ByteBuffer[] srcs, int offset, int length)-
Methods inherited from class jnr.unixsocket.impl.AbstractNativeDatagramChannel
getFD, implCloseSelectableChannel, implConfigureBlocking, read, setFD
-
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
-
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
-
-
-
Method Detail
-
open
public static final UnixDatagramChannel open() throws java.io.IOException
- Throws:
java.io.IOException
-
open
public static final UnixDatagramChannel open(jnr.constants.platform.ProtocolFamily domain, int protocol) throws java.io.IOException
- Throws:
java.io.IOException
-
pair
public static final UnixDatagramChannel[] pair() throws java.io.IOException
- Throws:
java.io.IOException
-
bind
public UnixDatagramChannel bind(java.net.SocketAddress local) throws java.io.IOException
- Specified by:
bindin interfacejava.nio.channels.NetworkChannel- Specified by:
bindin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
connect
public UnixDatagramChannel connect(UnixSocketAddress remote)
-
disconnect
public UnixDatagramChannel disconnect() throws java.io.IOException
- Specified by:
disconnectin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin classjava.nio.channels.DatagramChannel
-
getRemoteSocketAddress
public final UnixSocketAddress getRemoteSocketAddress()
-
getLocalSocketAddress
public final UnixSocketAddress getLocalSocketAddress()
-
receive
public UnixSocketAddress receive(java.nio.ByteBuffer src) throws java.io.IOException
- Specified by:
receivein classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
send
public int send(java.nio.ByteBuffer src, java.net.SocketAddress target) throws java.io.IOException- Specified by:
sendin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
connect
public java.nio.channels.DatagramChannel connect(java.net.SocketAddress remote) throws java.io.IOException- Specified by:
connectin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
socket
public UnixDatagramSocket socket()
- Specified by:
socketin classjava.nio.channels.DatagramChannel
-
write
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.GatheringByteChannel- Overrides:
writein classAbstractNativeDatagramChannel- Throws:
java.io.IOException
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Overrides:
readin classAbstractNativeDatagramChannel- Throws:
java.io.IOException
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Overrides:
writein classAbstractNativeDatagramChannel- Throws:
java.io.IOException
-
getRemoteAddress
public java.net.SocketAddress getRemoteAddress() throws java.io.IOException- Specified by:
getRemoteAddressin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
getLocalAddress
public java.net.SocketAddress getLocalAddress() throws java.io.IOException- Specified by:
getLocalAddressin interfacejava.nio.channels.NetworkChannel- Specified by:
getLocalAddressin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
supportedOptions
public final java.util.Set<java.net.SocketOption<?>> supportedOptions()
-
getOption
public <T> T getOption(java.net.SocketOption<T> name) throws java.io.IOException- Throws:
java.io.IOException
-
setOption
public <T> java.nio.channels.DatagramChannel setOption(java.net.SocketOption<T> name, T value) throws java.io.IOException- Specified by:
setOptionin interfacejava.nio.channels.NetworkChannel- Specified by:
setOptionin classjava.nio.channels.DatagramChannel- Throws:
java.io.IOException
-
join
public java.nio.channels.MembershipKey join(java.net.InetAddress group, java.net.NetworkInterface interf)
-
join
public java.nio.channels.MembershipKey join(java.net.InetAddress group, java.net.NetworkInterface interf, java.net.InetAddress source)
-
-