Module org.newsclub.net.unix.darwin
Class AFSYSTEMServerSocket
java.lang.Object
java.net.ServerSocket
org.newsclub.net.unix.AFServerSocket<AFSYSTEMSocketAddress>
org.newsclub.net.unix.darwin.system.AFSYSTEMServerSocket
- All Implemented Interfaces:
Closeable,AutoCloseable,AFSomeSocketThing,FileDescriptorAccess
The server part of an
AF_SYSTEM socket.- Author:
- Christian Kohlschütter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFServerSocket
AFServerSocket.Constructor<A extends AFSocketAddress> -
Method Summary
Modifier and TypeMethodDescriptionaccept()static AFSYSTEMServerSocketbindOn(AFSYSTEMSocketAddress addr) Returns a new AF_SYSTEMServerSocketthat is bound to the givenAFSYSTEMSocketAddress.static AFSYSTEMServerSocketbindOn(AFSYSTEMSocketAddress addr, boolean deleteOnClose) Returns a new AF_SYSTEMServerSocketthat is bound to the givenAFSocketAddress.static AFSYSTEMServerSocketforceBindOn(AFSYSTEMSocketAddress forceAddr) Returns a new, unbound AF_SYSTEMServerSocketthat will always bind to the given address, regardless of any socket address used in a call tobind.protected AFServerSocketChannel<AFSYSTEMSocketAddress> Creates a new AFServerSocketChannel for this socket.protected AFSocketImpl<AFSYSTEMSocketAddress> newImpl(FileDescriptor fdObj) Creates a new AFSocketImpl.static AFSYSTEMServerSocketReturns a new, unbound AF_SYSTEMServerSocket.protected AFSocket<AFSYSTEMSocketAddress> Returns a newAFSocketinstance.Methods inherited from class org.newsclub.net.unix.AFServerSocket
addCloseable, addressFamily, bind, bind, bindHook, bindOn, bindOn, close, forceBindAddress, forceBindOn, getFileDescriptor, getInetAddress, getLocalPort, getLocalSocketAddress, getOption, getReceiveBufferSize, getReuseAddress, getSoTimeout, isBound, isClosed, isDeleteOnClose, isLocalSocketAddressValid, isSupported, newInstance, newInstance, removeCloseable, setDeleteOnClose, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setShutdownOnClose, setSoTimeout, supportedOptions, toStringMethods inherited from class java.net.ServerSocket
implAccept, setSocketFactory
-
Method Details
-
newChannel
Description copied from class:AFServerSocketCreates a new AFServerSocketChannel for this socket.- Specified by:
newChannelin classAFServerSocket<AFSYSTEMSocketAddress>- Returns:
- The new instance.
-
getChannel
- Overrides:
getChannelin classAFServerSocket<AFSYSTEMSocketAddress>
-
newInstance
Returns a new, unbound AF_SYSTEMServerSocket.- Returns:
- The new, unbound
AFServerSocket. - Throws:
IOException- if the operation fails.
-
bindOn
Returns a new AF_SYSTEMServerSocketthat is bound to the givenAFSYSTEMSocketAddress.- Parameters:
addr- The socket file to bind to.- Returns:
- The new, bound
AFServerSocket. - Throws:
IOException- if the operation fails.
-
bindOn
public static AFSYSTEMServerSocket bindOn(AFSYSTEMSocketAddress addr, boolean deleteOnClose) throws IOException Returns a new AF_SYSTEMServerSocketthat is bound to the givenAFSocketAddress.- Parameters:
addr- The socket file to bind to.deleteOnClose- Iftrue, the socket file (if the address points to a file) will be deleted uponAFServerSocket.close().- Returns:
- The new, bound
AFServerSocket. - Throws:
IOException- if the operation fails.
-
forceBindOn
Returns a new, unbound AF_SYSTEMServerSocketthat will always bind to the given address, regardless of any socket address used in a call tobind.- Parameters:
forceAddr- The address to use.- Returns:
- The new, yet unbound
AFServerSocket. - Throws:
IOException- if an exception occurs.
-
newImpl
Description copied from class:AFServerSocketCreates a new AFSocketImpl.- Specified by:
newImplin classAFServerSocket<AFSYSTEMSocketAddress>- Parameters:
fdObj- The file descriptor.- Returns:
- The new instance.
- Throws:
SocketException
-
newSocketInstance
Description copied from class:AFServerSocketReturns a newAFSocketinstance.- Specified by:
newSocketInstancein classAFServerSocket<AFSYSTEMSocketAddress>- Returns:
- The new instance.
- Throws:
IOException- on error.
-
accept
- Overrides:
acceptin classAFServerSocket<AFSYSTEMSocketAddress>- Throws:
IOException
-