java.lang.Object
java.nio.channels.spi.SelectorProvider
org.newsclub.net.unix.AFSelectorProvider<AFTIPCSocketAddress>
org.newsclub.net.unix.tipc.AFTIPCSelectorProvider
Service-provider class for junixsocket selectors and selectable channels.
-
Method Summary
Modifier and TypeMethodDescriptionprotected AFAddressFamily<@NonNull AFTIPCSocketAddress> Returns the address family supported by this implementation.static AFTIPCSelectorProviderReturns the singleton instance.protected AFTIPCSocketConstructs a new socket.protected <P extends AFSomeSocket>
AFSocketPair<P> newSocketPair(P s1, P s2) Constructs a new socket pair from two sockets.openDatagramChannel(ProtocolFamily family) Opens aDatagramChannelusing the given socket type.Opens a socket pair of interconnected datagram channels.Opens a socket pair of interconnectedDatagramChannels, using the givenAFSocketType.Opens a server-socket channel bound on the givenSocketAddress.Opens a socket channel connected to the givenSocketAddress.Opens a socket pair of interconnected channels.protected ProtocolFamilyReturns the protocol family supported by this implementation.static AFTIPCSelectorProviderprovider()Returns the singleton instance.Methods inherited from class org.newsclub.net.unix.AFSelectorProvider
domainId, openPipe, openSelector, openServerSocketChannel, openSocketChannelMethods inherited from class java.nio.channels.spi.SelectorProvider
inheritedChannel
-
Method Details
-
getInstance
Returns the singleton instance.- Returns:
- The instance.
-
provider
Returns the singleton instance.- Returns:
- The instance.
-
newSocketPair
Constructs a new socket pair from two sockets.- Specified by:
newSocketPairin classAFSelectorProvider<AFTIPCSocketAddress>- Type Parameters:
P- The type of the pair.- Parameters:
s1- Some socket, the first one.s2- Some socket, the second one.- Returns:
- The pair.
-
openSocketChannelPair
Description copied from class:AFSelectorProviderOpens a socket pair of interconnected channels.- Overrides:
openSocketChannelPairin classAFSelectorProvider<AFTIPCSocketAddress>- Returns:
- The new channel pair.
- Throws:
IOException- on error.
-
openDatagramChannelPair
Description copied from class:AFSelectorProviderOpens a socket pair of interconnected datagram channels.- Overrides:
openDatagramChannelPairin classAFSelectorProvider<AFTIPCSocketAddress>- Returns:
- The new channel pair.
- Throws:
IOException- on error.
-
openDatagramChannelPair
public AFTIPCSocketPair<AFTIPCDatagramChannel> openDatagramChannelPair(AFSocketType type) throws IOException Description copied from class:AFSelectorProviderOpens a socket pair of interconnectedDatagramChannels, using the givenAFSocketType.- Overrides:
openDatagramChannelPairin classAFSelectorProvider<AFTIPCSocketAddress>- Parameters:
type- The socket type.- Returns:
- The new channel pair.
- Throws:
IOException- on error.
-
newSocket
Description copied from class:AFSelectorProviderConstructs a new socket.- Specified by:
newSocketin classAFSelectorProvider<AFTIPCSocketAddress>- Returns:
- The socket instance.
- Throws:
IOException- on error.
-
openDatagramChannel
- Specified by:
openDatagramChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Throws:
IOException
-
openDatagramChannel
Description copied from class:AFSelectorProviderOpens aDatagramChannelusing the given socket type.- Specified by:
openDatagramChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Parameters:
type- The socket type.- Returns:
- the new channel
- Throws:
IOException- on error.
-
openDatagramChannel
- Overrides:
openDatagramChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Throws:
IOException
-
openServerSocketChannel
- Specified by:
openServerSocketChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Throws:
IOException
-
openServerSocketChannel
Description copied from class:AFSelectorProviderOpens a server-socket channel bound on the givenSocketAddress.- Specified by:
openServerSocketChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Parameters:
sa- The socket address to bind on.- Returns:
- The new channel
- Throws:
IOException- on error.
-
openSocketChannel
- Overrides:
openSocketChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Throws:
IOException
-
openSocketChannel
Description copied from class:AFSelectorProviderOpens a socket channel connected to the givenSocketAddress.- Specified by:
openSocketChannelin classAFSelectorProvider<AFTIPCSocketAddress>- Parameters:
sa- The socket address to connect to.- Returns:
- The new channel
- Throws:
IOException- on error.
-
protocolFamily
Description copied from class:AFSelectorProviderReturns the protocol family supported by this implementation.- Specified by:
protocolFamilyin classAFSelectorProvider<AFTIPCSocketAddress>- Returns:
- The protocol family.
-
addressFamily
Description copied from class:AFSelectorProviderReturns the address family supported by this implementation.- Specified by:
addressFamilyin classAFSelectorProvider<AFTIPCSocketAddress>- Returns:
- The address family.
-