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 AFTIPCSelectorProvider
Returns the singleton instance.protected AFTIPCSocket
Constructs 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 aDatagramChannel
using the given socket type.Opens a socket pair of interconnected datagram channels.Opens a socket pair of interconnectedDatagramChannel
s, 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 ProtocolFamily
Returns the protocol family supported by this implementation.static AFTIPCSelectorProvider
provider()
Returns the singleton instance.Methods inherited from class org.newsclub.net.unix.AFSelectorProvider
domainId, openPipe, openSelector, openServerSocketChannel, openSocketChannel
Methods 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:
newSocketPair
in 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:AFSelectorProvider
Opens a socket pair of interconnected channels.- Overrides:
openSocketChannelPair
in classAFSelectorProvider<AFTIPCSocketAddress>
- Returns:
- The new channel pair.
- Throws:
IOException
- on error.
-
openDatagramChannelPair
Description copied from class:AFSelectorProvider
Opens a socket pair of interconnected datagram channels.- Overrides:
openDatagramChannelPair
in classAFSelectorProvider<AFTIPCSocketAddress>
- Returns:
- The new channel pair.
- Throws:
IOException
- on error.
-
openDatagramChannelPair
public AFTIPCSocketPair<AFTIPCDatagramChannel> openDatagramChannelPair(AFSocketType type) throws IOException Description copied from class:AFSelectorProvider
Opens a socket pair of interconnectedDatagramChannel
s, using the givenAFSocketType
.- Overrides:
openDatagramChannelPair
in classAFSelectorProvider<AFTIPCSocketAddress>
- Parameters:
type
- The socket type.- Returns:
- The new channel pair.
- Throws:
IOException
- on error.
-
newSocket
Description copied from class:AFSelectorProvider
Constructs a new socket.- Specified by:
newSocket
in classAFSelectorProvider<AFTIPCSocketAddress>
- Returns:
- The socket instance.
- Throws:
IOException
- on error.
-
openDatagramChannel
- Specified by:
openDatagramChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Throws:
IOException
-
openDatagramChannel
Description copied from class:AFSelectorProvider
Opens aDatagramChannel
using the given socket type.- Specified by:
openDatagramChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Parameters:
type
- The socket type.- Returns:
- the new channel
- Throws:
IOException
- on error.
-
openDatagramChannel
- Overrides:
openDatagramChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Throws:
IOException
-
openServerSocketChannel
- Specified by:
openServerSocketChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Throws:
IOException
-
openServerSocketChannel
Description copied from class:AFSelectorProvider
Opens a server-socket channel bound on the givenSocketAddress
.- Specified by:
openServerSocketChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Parameters:
sa
- The socket address to bind on.- Returns:
- The new channel
- Throws:
IOException
- on error.
-
openSocketChannel
- Overrides:
openSocketChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Throws:
IOException
-
openSocketChannel
Description copied from class:AFSelectorProvider
Opens a socket channel connected to the givenSocketAddress
.- Specified by:
openSocketChannel
in classAFSelectorProvider<AFTIPCSocketAddress>
- Parameters:
sa
- The socket address to connect to.- Returns:
- The new channel
- Throws:
IOException
- on error.
-
protocolFamily
Description copied from class:AFSelectorProvider
Returns the protocol family supported by this implementation.- Specified by:
protocolFamily
in classAFSelectorProvider<AFTIPCSocketAddress>
- Returns:
- The protocol family.
-
addressFamily
Description copied from class:AFSelectorProvider
Returns the address family supported by this implementation.- Specified by:
addressFamily
in classAFSelectorProvider<AFTIPCSocketAddress>
- Returns:
- The address family.
-