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, localPortFields 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
ConstructorsModifierConstructorDescriptionprotectedAFDatagramSocketImpl(AFAddressFamily<@NonNull A> addressFamily, FileDescriptor fd, AFSocketType socketType) Constructs a newAFDatagramSocketImplusing the givenFileDescriptor(or null to create a new one). -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidbind(int lport, InetAddress laddr) protected final voidclose()protected final voidconnect(InetAddress address, int port) protected final voidcreate()protected final voidprotected final AFAddressFamily<@NonNull A>Returns the address family supported by this implementation.protected final FileDescriptorprotected final AFSocketImplExtensions<A>Returns the internal helper instance for address-specific extensions.getOption(int optID) protected <T> TgetOption(SocketOption<T> name) protected final intprotected final bytegetTTL()protected final voidjoin(InetAddress inetaddr) protected final voidjoinGroup(SocketAddress mcastaddr, NetworkInterface netIf) protected final voidleave(InetAddress inetaddr) protected final voidleaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) protected final intpeek(InetAddress i) protected final intprotected final voidprotected final voidvoidprotected <T> voidsetOption(SocketOption<T> name, T value) protected final voidsetTimeToLive(int ttl) protected final voidsetTTL(byte ttl) protected Set<SocketOption<?>>Methods inherited from class java.net.DatagramSocketImpl
getLocalPort
-
Constructor Details
-
AFDatagramSocketImpl
protected AFDatagramSocketImpl(AFAddressFamily<@NonNull A> addressFamily, FileDescriptor fd, AFSocketType socketType) throws IOException Constructs a newAFDatagramSocketImplusing the givenFileDescriptor(or null to create a new one).- Parameters:
addressFamily- The address family.fd- The file descriptor, ornull.socketType- The socket type.- Throws:
IOException- on error.
-
-
Method Details
-
create
- Specified by:
createin classDatagramSocketImpl- Throws:
SocketException
-
close
protected final void close()- Specified by:
closein classDatagramSocketImpl
-
connect
- Overrides:
connectin classDatagramSocketImpl- Throws:
SocketException
-
disconnect
protected final void disconnect()- Overrides:
disconnectin classDatagramSocketImpl
-
getFileDescriptor
- Overrides:
getFileDescriptorin classDatagramSocketImpl
-
bind
- Specified by:
bindin classDatagramSocketImpl- Throws:
SocketException
-
receive
- Specified by:
receivein classDatagramSocketImpl- Throws:
IOException
-
send
- Specified by:
sendin classDatagramSocketImpl- Throws:
IOException
-
peek
- Specified by:
peekin classDatagramSocketImpl- Throws:
IOException
-
peekData
- Specified by:
peekDatain classDatagramSocketImpl- Throws:
IOException
-
getTTL
- Specified by:
getTTLin classDatagramSocketImpl- Throws:
IOException
-
setTTL
- Specified by:
setTTLin classDatagramSocketImpl- Throws:
IOException
-
getTimeToLive
- Specified by:
getTimeToLivein classDatagramSocketImpl- Throws:
IOException
-
setTimeToLive
- Specified by:
setTimeToLivein classDatagramSocketImpl- Throws:
IOException
-
join
- Specified by:
joinin classDatagramSocketImpl- Throws:
IOException
-
leave
- Specified by:
leavein classDatagramSocketImpl- Throws:
IOException
-
joinGroup
- Specified by:
joinGroupin classDatagramSocketImpl- Throws:
IOException
-
leaveGroup
- Specified by:
leaveGroupin 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:
setOptionin classDatagramSocketImpl- Throws:
IOException
-
getOption
- Overrides:
getOptionin classDatagramSocketImpl- Throws:
IOException
-
supportedOptions
- Overrides:
supportedOptionsin classDatagramSocketImpl
-