java.lang.Object
org.newsclub.net.unix.server.SocketServer<SocketAddress,Socket,ServerSocket>
org.newsclub.net.unix.server.AFUNIXSocketServer
@Deprecated
public abstract class AFUNIXSocketServer
extends SocketServer<SocketAddress,Socket,ServerSocket>
Deprecated.
A base implementation for a simple, multi-threaded socket server.
This class supports both AF_UNIX and "regular" sockets.
- Author:
- Christian Kohlschütter
-
Constructor Summary
ConstructorsConstructorDescriptionAFUNIXSocketServer(ServerSocket serverSocket) Deprecated.Creates a server using the given, boundServerSocket.AFUNIXSocketServer(SocketAddress listenAddress) Deprecated.Creates a server using the givenSocketAddress. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerSocketDeprecated.Returns a new server socket.booleanstartAndWait(long duration, TimeUnit unit) Deprecated.Methods inherited from class org.newsclub.net.unix.server.SocketServer
doServeSocket, doSocketClose, getListenAddress, getMaxConcurrentConnections, getServerBusyTimeout, getServerTimeout, getSocketTimeout, isReady, isRunning, onAfterServingSocket, onBeforeServingSocket, onListenException, onListenException, onServerBound, onServerBusy, onServerReady, onServerShuttingDown, onServerStarting, onServerStopped, onServingException, onServingException, onSocketExceptionAfterAccept, onSocketExceptionDuringAccept, onSubmitted, setMaxConcurrentConnections, setServerBusyTimeout, setServerTimeout, setSocketTimeout, start, startAndWaitToBecomeReady, startAndWaitToBecomeReady, startThenStopAfter, stop
-
Constructor Details
-
AFUNIXSocketServer
Deprecated.Creates a server using the given, boundServerSocket.- Parameters:
serverSocket- The server socket to use (must be bound).
-
AFUNIXSocketServer
Deprecated.Creates a server using the givenSocketAddress.- Parameters:
listenAddress- The address to bind the socket on.
-
-
Method Details
-
startAndWait
Deprecated.Starts the server and waits until it is ready or had to shop due to an error.- Parameters:
duration- The duration wait.unit- The duration's time unit.- Returns:
trueif the server is ready to serve requests.- Throws:
InterruptedException- If the wait was interrupted.- See Also:
-
newServerSocket
Deprecated.Description copied from class:SocketServerReturns a new server socket.- Specified by:
newServerSocketin classSocketServer<SocketAddress,Socket, ServerSocket> - Returns:
- The new socket (an
AFServerSocketif the listen address is anAFSocketAddress). - Throws:
IOException- on error.
-
SocketServerorAFSocketServer