Module org.newsclub.net.unix.darwin
Class AFSYSTEMSelectorProvider
java.lang.Object
java.nio.channels.spi.SelectorProvider
org.newsclub.net.unix.AFSelectorProvider<AFSYSTEMSocketAddress>
org.newsclub.net.unix.darwin.system.AFSYSTEMSelectorProvider
Service-provider class for junixsocket selectors and selectable channels.
-
Method Summary
Modifier and TypeMethodDescriptionprotected AFAddressFamily
<@NonNull AFSYSTEMSocketAddress> Returns the address family supported by this implementation.static AFSYSTEMSelectorProvider
Returns the singleton instance.protected AFSYSTEMSocket
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 AFSYSTEMSelectorProvider
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<AFSYSTEMSocketAddress>
- 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<AFSYSTEMSocketAddress>
- 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<AFSYSTEMSocketAddress>
- Returns:
- The new channel pair.
- Throws:
IOException
- on error.
-
openDatagramChannelPair
public AFSYSTEMSocketPair<AFSYSTEMDatagramChannel> openDatagramChannelPair(AFSocketType type) throws IOException Description copied from class:AFSelectorProvider
Opens a socket pair of interconnectedDatagramChannel
s, using the givenAFSocketType
.- Overrides:
openDatagramChannelPair
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- 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<AFSYSTEMSocketAddress>
- Returns:
- The socket instance.
- Throws:
IOException
- on error.
-
openDatagramChannel
- Specified by:
openDatagramChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Throws:
IOException
-
openDatagramChannel
Description copied from class:AFSelectorProvider
Opens aDatagramChannel
using the given socket type.- Specified by:
openDatagramChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Parameters:
type
- The socket type.- Returns:
- the new channel
- Throws:
IOException
- on error.
-
openDatagramChannel
- Overrides:
openDatagramChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Throws:
IOException
-
openServerSocketChannel
- Specified by:
openServerSocketChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Throws:
IOException
-
openServerSocketChannel
Description copied from class:AFSelectorProvider
Opens a server-socket channel bound on the givenSocketAddress
.- Specified by:
openServerSocketChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Parameters:
sa
- The socket address to bind on.- Returns:
- The new channel
- Throws:
IOException
- on error.
-
openSocketChannel
- Overrides:
openSocketChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Throws:
IOException
-
openSocketChannel
Description copied from class:AFSelectorProvider
Opens a socket channel connected to the givenSocketAddress
.- Specified by:
openSocketChannel
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- 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<AFSYSTEMSocketAddress>
- Returns:
- The protocol family.
-
addressFamily
Description copied from class:AFSelectorProvider
Returns the address family supported by this implementation.- Specified by:
addressFamily
in classAFSelectorProvider<AFSYSTEMSocketAddress>
- Returns:
- The address family.
-