java.lang.Object
java.net.DatagramSocket
org.newsclub.net.unix.AFDatagramSocket<AFVSOCKSocketAddress>
org.newsclub.net.unix.vsock.AFVSOCKDatagramSocket
- All Implemented Interfaces:
Closeable
,AutoCloseable
,AFSocketExtensions
,AFSomeSocket
,AFSomeSocketThing
,FileDescriptorAccess
,AFVSOCKSocketExtensions
public final class AFVSOCKDatagramSocket
extends AFDatagramSocket<AFVSOCKSocketAddress>
implements AFVSOCKSocketExtensions
A
DatagramSocket
implementation that works with AF_VSOCK
sockets.- Author:
- Christian Kohlschütter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFDatagramSocket
AFDatagramSocket.Constructor<A extends AFSocketAddress>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum size for user messages. -
Method Summary
Modifier and TypeMethodDescription<T> T
getOption
(SocketOption<T> name) protected AFVSOCKDatagramChannel
Creates a newDatagramChannel
that is associated with this socket.protected AFDatagramSocket
<AFVSOCKSocketAddress> Returns a newAFDatagramSocket
instance to be used forAFDatagramSocket.accept()
, i.e., noFileDescriptor
is associated.static AFVSOCKDatagramSocket
Returns a newAFVSOCKDatagramSocket
instance, using the defaultAFSocketType.SOCK_DGRAM
socket type.static AFVSOCKDatagramSocket
newInstance
(AFSocketType socketType) Returns a newAFVSOCKDatagramSocket
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, getImplExtensions, 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
-
Field Details
-
VSOCK_MAX_USER_MSG_SIZE
public static final int VSOCK_MAX_USER_MSG_SIZEThe maximum size for user messages.- See Also:
-
-
Method Details
-
newChannel
Description copied from class:AFDatagramSocket
Creates a newDatagramChannel
that is associated with this socket.- Specified by:
newChannel
in classAFDatagramSocket<AFVSOCKSocketAddress>
- Returns:
- The channel.
-
newInstance
Returns a newAFVSOCKDatagramSocket
instance, using the defaultAFSocketType.SOCK_DGRAM
socket type.- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
newInstance
Returns a newAFVSOCKDatagramSocket
instance for the given socket type.- Parameters:
socketType
- The socket type.- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
getChannel
- Overrides:
getChannel
in classAFDatagramSocket<AFVSOCKSocketAddress>
-
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<AFVSOCKSocketAddress>
- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
getOption
- Overrides:
getOption
in classDatagramSocket
- Throws:
IOException
-
setOption
- Overrides:
setOption
in classDatagramSocket
- Throws:
IOException
-