Module org.newsclub.net.unix
Package org.newsclub.net.unix
Class AFDatagramSocketImpl<A extends AFSocketAddress>
java.lang.Object
java.net.DatagramSocketImpl
org.newsclub.net.unix.AFDatagramSocketImpl<A>
- Type Parameters:
A
- The associated address type.
- All Implemented Interfaces:
SocketOptions
A
DatagramSocketImpl
implemented by junixsocket.- Author:
- Christian Kohlschütter
-
Field Summary
Fields inherited from class java.net.DatagramSocketImpl
fd
Fields inherited from interface java.net.SocketOptions
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_REUSEPORT, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY
-
Constructor Summary
ModifierConstructorDescriptionprotected
AFDatagramSocketImpl
(AFAddressFamily<@NonNull A> addressFamily, FileDescriptor fd, AFSocketType socketType) Constructs a newAFDatagramSocketImpl
using the givenFileDescriptor
(or null to create a new one). -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
bind
(int lport, InetAddress laddr) protected final void
close()
protected final void
connect
(InetAddress address, int port) protected final void
create()
protected final void
protected final AFAddressFamily
<@NonNull A> Returns the address family supported by this implementation.protected final FileDescriptor
protected final AFSocketImplExtensions
<A> Returns the internal helper instance for address-specific extensions.getOption
(int optID) protected <T> T
getOption
(SocketOption<T> name) protected final int
protected final byte
getTTL()
Deprecated.protected final void
join
(InetAddress inetaddr) protected final void
joinGroup
(SocketAddress mcastaddr, NetworkInterface netIf) protected final void
leave
(InetAddress inetaddr) protected final void
leaveGroup
(SocketAddress mcastaddr, NetworkInterface netIf) protected final int
peek
(InetAddress i) protected final int
protected final void
protected final void
void
protected <T> void
setOption
(SocketOption<T> name, T value) protected final void
setTimeToLive
(int ttl) protected final void
setTTL
(byte ttl) Deprecated.protected Set
<SocketOption<?>> Methods inherited from class java.net.DatagramSocketImpl
getLocalPort
-
Constructor Details
-
AFDatagramSocketImpl
protected AFDatagramSocketImpl(AFAddressFamily<@NonNull A> addressFamily, FileDescriptor fd, AFSocketType socketType) Constructs a newAFDatagramSocketImpl
using the givenFileDescriptor
(or null to create a new one).- Parameters:
addressFamily
- The address family.fd
- The file descriptor, ornull
.socketType
- The socket type.
-
-
Method Details
-
create
- Specified by:
create
in classDatagramSocketImpl
- Throws:
SocketException
-
close
protected final void close()- Specified by:
close
in classDatagramSocketImpl
-
connect
- Overrides:
connect
in classDatagramSocketImpl
- Throws:
SocketException
-
disconnect
protected final void disconnect()- Overrides:
disconnect
in classDatagramSocketImpl
-
getFileDescriptor
- Overrides:
getFileDescriptor
in classDatagramSocketImpl
-
bind
- Specified by:
bind
in classDatagramSocketImpl
- Throws:
SocketException
-
receive
- Specified by:
receive
in classDatagramSocketImpl
- Throws:
IOException
-
send
- Specified by:
send
in classDatagramSocketImpl
- Throws:
IOException
-
peek
- Specified by:
peek
in classDatagramSocketImpl
- Throws:
IOException
-
peekData
- Specified by:
peekData
in classDatagramSocketImpl
- Throws:
IOException
-
getTTL
Deprecated.- Specified by:
getTTL
in classDatagramSocketImpl
- Throws:
IOException
-
setTTL
Deprecated.- Specified by:
setTTL
in classDatagramSocketImpl
- Throws:
IOException
-
getTimeToLive
- Specified by:
getTimeToLive
in classDatagramSocketImpl
- Throws:
IOException
-
setTimeToLive
- Specified by:
setTimeToLive
in classDatagramSocketImpl
- Throws:
IOException
-
join
- Specified by:
join
in classDatagramSocketImpl
- Throws:
IOException
-
leave
- Specified by:
leave
in classDatagramSocketImpl
- Throws:
IOException
-
joinGroup
- Specified by:
joinGroup
in classDatagramSocketImpl
- Throws:
IOException
-
leaveGroup
- Specified by:
leaveGroup
in classDatagramSocketImpl
- Throws:
IOException
-
getOption
- Throws:
SocketException
-
setOption
- Throws:
SocketException
-
getAddressFamily
Returns the address family supported by this implementation.- Returns:
- The family.
-
getImplExtensions
Returns the internal helper instance for address-specific extensions.- Returns:
- The helper instance.
- Throws:
UnsupportedOperationException
- if such extensions are not supported for this address type.
-
setOption
- Overrides:
setOption
in classDatagramSocketImpl
- Throws:
IOException
-
getOption
- Overrides:
getOption
in classDatagramSocketImpl
- Throws:
IOException
-
supportedOptions
- Overrides:
supportedOptions
in classDatagramSocketImpl
-