Module org.newsclub.net.unix.darwin
Class AFSYSTEMDatagramSocket
java.lang.Object
java.net.DatagramSocket
org.newsclub.net.unix.AFDatagramSocket<AFSYSTEMSocketAddress>
org.newsclub.net.unix.darwin.system.AFSYSTEMDatagramSocket
- All Implemented Interfaces:
Closeable
,AutoCloseable
,AFSocketExtensions
,AFSomeSocket
,AFSomeSocketThing
,AFSYSTEMSocketExtensions
,FileDescriptorAccess
public final class AFSYSTEMDatagramSocket
extends AFDatagramSocket<AFSYSTEMSocketAddress>
implements AFSYSTEMSocketExtensions
A
DatagramSocket
implementation that works with AF_SYSTEM
sockets.- Author:
- Christian Kohlschütter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFDatagramSocket
AFDatagramSocket.Constructor<A extends AFSocketAddress>
-
Method Summary
Modifier and TypeMethodDescriptionprotected AFSYSTEMSocketImplExtensions
Returns the internal helper instance for address-specific extensions.int
getNodeIdentity
(String name) Retrieves the kernel control ID given a kernel control name.int
Retrieves the kernel control ID given a kernel control name.<T> T
getOption
(SocketOption<T> name) protected AFSYSTEMDatagramChannel
Creates a newDatagramChannel
that is associated with this socket.protected AFDatagramSocket
<AFSYSTEMSocketAddress> Returns a newAFDatagramSocket
instance to be used forAFDatagramSocket.accept()
, i.e., noFileDescriptor
is associated.static AFSYSTEMDatagramSocket
Returns a newAFSYSTEMDatagramSocket
instance, using the defaultAFSocketType.SOCK_DGRAM
socket type.static AFSYSTEMDatagramSocket
newInstance
(AFSocketType socketType) Returns a newAFSYSTEMDatagramSocket
instance for the given socket type.<T> DatagramSocket
setOption
(SocketOption<T> name, T value) Methods inherited from class org.newsclub.net.unix.AFDatagramSocket
accept, addressFamily, bind, close, connect, connect, ensureAncillaryReceiveBufferSize, getAncillaryReceiveBufferSize, getFileDescriptor, getLocalSocketAddress, getOption, getRemoteSocketAddress, isBound, isClosed, isConnected, isDeleteOnClose, listen, newInstance, newInstance, peek, receive, send, setAncillaryReceiveBufferSize, setDeleteOnClose, setOption, setShutdownOnClose, socketAddressClass
Methods inherited from class java.net.DatagramSocket
disconnect, getBroadcast, getInetAddress, getLocalAddress, getLocalPort, getPort, getReceiveBufferSize, getReuseAddress, getSendBufferSize, getSoTimeout, getTrafficClass, joinGroup, leaveGroup, setBroadcast, setDatagramSocketImplFactory, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTrafficClass, supportedOptions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.newsclub.net.unix.AFSocketExtensions
ensureAncillaryReceiveBufferSize, getAncillaryReceiveBufferSize, setAncillaryReceiveBufferSize
-
Method Details
-
newChannel
Description copied from class:AFDatagramSocket
Creates a newDatagramChannel
that is associated with this socket.- Specified by:
newChannel
in classAFDatagramSocket<AFSYSTEMSocketAddress>
- Returns:
- The channel.
-
newInstance
Returns a newAFSYSTEMDatagramSocket
instance, using the defaultAFSocketType.SOCK_DGRAM
socket type.- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
newInstance
Returns a newAFSYSTEMDatagramSocket
instance for the given socket type.- Parameters:
socketType
- The socket type.- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
getChannel
- Overrides:
getChannel
in classAFDatagramSocket<AFSYSTEMSocketAddress>
-
getImplExtensions
Description copied from class:AFDatagramSocket
Returns the internal helper instance for address-specific extensions.- Overrides:
getImplExtensions
in classAFDatagramSocket<AFSYSTEMSocketAddress>
- Returns:
- The helper instance.
-
getNodeIdentity
Retrieves the kernel control ID given a kernel control name. AnIOException
is thrown if the ID is invalid or could not be accessed due to access restrictions.- Parameters:
name
- The control name- Returns:
- The control Id.
- Throws:
IOException
- on error.
-
getNodeIdentity
Retrieves the kernel control ID given a kernel control name. AnIOException
is thrown if the ID is invalid or could not be accessed due to access restrictions.- Parameters:
name
- The control name- Returns:
- The control Id.
- Throws:
IOException
- on error.
-
newDatagramSocketInstance
Description copied from class:AFDatagramSocket
Returns a newAFDatagramSocket
instance to be used forAFDatagramSocket.accept()
, i.e., noFileDescriptor
is associated.- Specified by:
newDatagramSocketInstance
in classAFDatagramSocket<AFSYSTEMSocketAddress>
- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
getOption
- Overrides:
getOption
in classDatagramSocket
- Throws:
IOException
-
setOption
- Overrides:
setOption
in classDatagramSocket
- Throws:
IOException
-