java.lang.Object
java.net.DatagramSocket
org.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress>
org.newsclub.net.unix.vsock.AFVSOCKDatagramSocket
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.newsclub.net.unix.AFSocketExtensions
,org.newsclub.net.unix.AFSomeSocket
,org.newsclub.net.unix.AFSomeSocketThing
,org.newsclub.net.unix.FileDescriptorAccess
,AFVSOCKSocketExtensions
public final class AFVSOCKDatagramSocket
extends org.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.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
org.newsclub.net.unix.AFDatagramSocket.Constructor<A extends org.newsclub.net.unix.AFSocketAddress>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum size for user messages. -
Method Summary
Modifier and TypeMethodDescription<T> T
getOption
(SocketOption<T> arg0) protected AFVSOCKDatagramChannel
protected org.newsclub.net.unix.AFDatagramSocket
<org.newsclub.net.unix.AFVSOCKSocketAddress> static AFVSOCKDatagramSocket
Returns a newAFVSOCKDatagramSocket
instance, using the defaultAFSocketType.SOCK_DGRAM
socket type.static AFVSOCKDatagramSocket
newInstance
(org.newsclub.net.unix.AFSocketType socketType) Returns a newAFVSOCKDatagramSocket
instance for the given socket type.<T> DatagramSocket
setOption
(SocketOption<T> arg0, T arg1) 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
- Specified by:
newChannel
in classorg.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress>
-
newInstance
Returns a newAFVSOCKDatagramSocket
instance, using the defaultAFSocketType.SOCK_DGRAM
socket type.- Returns:
- The new instance.
- Throws:
IOException
- on error.
-
newInstance
public static AFVSOCKDatagramSocket newInstance(org.newsclub.net.unix.AFSocketType socketType) throws IOException 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 classorg.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress>
-
newDatagramSocketInstance
protected org.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress> newDatagramSocketInstance() throws IOException- Specified by:
newDatagramSocketInstance
in classorg.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress>
- Throws:
IOException
-
getOption
- Overrides:
getOption
in classDatagramSocket
- Throws:
IOException
-
setOption
- Overrides:
setOption
in classDatagramSocket
- Throws:
IOException
-