Class AFVSOCKDatagramSocket

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.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
  • Field Details

    • VSOCK_MAX_USER_MSG_SIZE

      public static final int VSOCK_MAX_USER_MSG_SIZE
      The maximum size for user messages.
      See Also:
  • Method Details

    • newChannel

      protected AFVSOCKDatagramChannel newChannel()
      Specified by:
      newChannel in class org.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress>
    • newInstance

      public static AFVSOCKDatagramSocket newInstance() throws IOException
      Returns a new AFVSOCKDatagramSocket instance, using the default AFSocketType.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 new AFVSOCKDatagramSocket instance for the given socket type.
      Parameters:
      socketType - The socket type.
      Returns:
      The new instance.
      Throws:
      IOException - on error.
    • getChannel

      public AFVSOCKDatagramChannel getChannel()
      Overrides:
      getChannel in class org.newsclub.net.unix.AFDatagramSocket<org.newsclub.net.unix.AFVSOCKSocketAddress>