Class AFVSOCKSelectorProvider

java.lang.Object
java.nio.channels.spi.SelectorProvider
org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
org.newsclub.net.unix.vsock.AFVSOCKSelectorProvider

public final class AFVSOCKSelectorProvider extends org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
Service-provider class for junixsocket selectors and selectable channels.
  • Method Details

    • getInstance

      public static AFVSOCKSelectorProvider getInstance()
      Returns the singleton instance.
      Returns:
      The instance.
    • provider

      public static AFVSOCKSelectorProvider provider()
      Returns the singleton instance.
      Returns:
      The instance.
    • newSocketPair

      protected <P extends org.newsclub.net.unix.AFSomeSocket> org.newsclub.net.unix.AFSocketPair<P> newSocketPair(P s1, P s2)
      Constructs a new socket pair from two sockets.
      Specified by:
      newSocketPair in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Parameters:
      s1 - Some socket, the first one.
      s2 - Some socket, the second one.
      Returns:
      The pair.
    • openSocketChannelPair

      public AFVSOCKSocketPair<AFVSOCKSocketChannel> openSocketChannelPair() throws IOException
      Overrides:
      openSocketChannelPair in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openDatagramChannelPair

      public AFVSOCKSocketPair<AFVSOCKDatagramChannel> openDatagramChannelPair() throws IOException
      Overrides:
      openDatagramChannelPair in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • newSocket

      protected AFVSOCKSocket newSocket() throws IOException
      Specified by:
      newSocket in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openDatagramChannel

      public AFVSOCKDatagramChannel openDatagramChannel() throws IOException
      Specified by:
      openDatagramChannel in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openDatagramChannel

      public AFVSOCKDatagramChannel openDatagramChannel(ProtocolFamily family) throws IOException
      Overrides:
      openDatagramChannel in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openServerSocketChannel

      public AFVSOCKServerSocketChannel openServerSocketChannel() throws IOException
      Specified by:
      openServerSocketChannel in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openServerSocketChannel

      public AFVSOCKServerSocketChannel openServerSocketChannel(SocketAddress sa) throws IOException
      Specified by:
      openServerSocketChannel in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openSocketChannel

      public AFVSOCKSocketChannel openSocketChannel() throws IOException
      Overrides:
      openSocketChannel in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • openSocketChannel

      public AFVSOCKSocketChannel openSocketChannel(SocketAddress sa) throws IOException
      Specified by:
      openSocketChannel in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
      Throws:
      IOException
    • protocolFamily

      protected ProtocolFamily protocolFamily()
      Specified by:
      protocolFamily in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>
    • addressFamily

      protected org.newsclub.net.unix.AFAddressFamily<@NonNull org.newsclub.net.unix.AFVSOCKSocketAddress> addressFamily()
      Specified by:
      addressFamily in class org.newsclub.net.unix.AFSelectorProvider<org.newsclub.net.unix.AFVSOCKSocketAddress>